diff --git a/chromium_src/chrome/browser/media/desktop_media_list_observer.h b/chromium_src/chrome/browser/media/desktop_media_list_observer.h index 34cd626bf6bf..5df6f4f8b0e5 100644 --- a/chromium_src/chrome/browser/media/desktop_media_list_observer.h +++ b/chromium_src/chrome/browser/media/desktop_media_list_observer.h @@ -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: diff --git a/chromium_src/chrome/browser/media/native_desktop_media_list.cc b/chromium_src/chrome/browser/media/native_desktop_media_list.cc index 4a9c0e03c8b0..f6a92a54942c 100644 --- a/chromium_src/chrome/browser/media/native_desktop_media_list.cc +++ b/chromium_src/chrome/browser/media/native_desktop_media_list.cc @@ -368,5 +368,8 @@ void NativeDesktopMediaList::OnRefreshFinished() { base::Bind(&NativeDesktopMediaList::Refresh, weak_factory_.GetWeakPtr()), update_period_); + } else { + // Destroy the capturers. + worker_.reset(); } }