Ensure DesktopCapturers are destroyed when no longer needed.
This commit is contained in:
parent
5b9d31d3ff
commit
a8759a3176
2 changed files with 6 additions and 0 deletions
|
@ -14,6 +14,9 @@ class DesktopMediaListObserver {
|
|||
virtual void OnSourceMoved(int old_index, int new_index) = 0;
|
||||
virtual void OnSourceNameChanged(int index) = 0;
|
||||
virtual void OnSourceThumbnailChanged(int index) = 0;
|
||||
|
||||
// Return false to stop refreshing. The associated |DesktopMediaList| should
|
||||
// no longer be used.
|
||||
virtual bool OnRefreshFinished() = 0;
|
||||
|
||||
protected:
|
||||
|
|
|
@ -368,5 +368,8 @@ void NativeDesktopMediaList::OnRefreshFinished() {
|
|||
base::Bind(&NativeDesktopMediaList::Refresh,
|
||||
weak_factory_.GetWeakPtr()),
|
||||
update_period_);
|
||||
} else {
|
||||
// Destroy the capturers.
|
||||
worker_.reset();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue