зеркало из https://github.com/electron/electron.git
Merge pull request #10223 from ajmacd/shutdown-desktop-capturers
Ensure DesktopCapturers are destroyed when no longer needed.
This commit is contained in:
Коммит
c6289ef219
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче