Skip to content

Commit

Permalink
fix: desktop screen capture on macOS not releasing (#33314)
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Mar 17, 2022
1 parent 2b5c403 commit 679c979
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions patches/chromium/desktop_media_list.patch
Expand Up @@ -52,7 +52,7 @@ index 98cc4e039ba2b5a467175b15650a7b8ef38e8249..f5aea6a5916b9aa56ee7b81a8de97dc4
const Source& GetSource(int index) const override;
DesktopMediaList::Type GetMediaListType() const override;
diff --git a/chrome/browser/media/webrtc/native_desktop_media_list.cc b/chrome/browser/media/webrtc/native_desktop_media_list.cc
index c899b52ef01d2c9ea16b281a2b7c4d37f175fa36..f752163d4e1951b2f79c7cc1cb4db51c0965472e 100644
index c899b52ef01d2c9ea16b281a2b7c4d37f175fa36..5d47550a96e670ce6f0b274e3d683589d8fa3999 100644
--- a/chrome/browser/media/webrtc/native_desktop_media_list.cc
+++ b/chrome/browser/media/webrtc/native_desktop_media_list.cc
@@ -16,7 +16,7 @@
Expand All @@ -72,7 +72,17 @@ index c899b52ef01d2c9ea16b281a2b7c4d37f175fa36..f752163d4e1951b2f79c7cc1cb4db51c
const base::Feature kWindowCaptureMacV2{"WindowCaptureMacV2",
base::FEATURE_DISABLED_BY_DEFAULT};
#endif
@@ -427,6 +428,11 @@ void NativeDesktopMediaList::RefreshForVizFrameSinkWindows(
@@ -273,6 +274,9 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
FROM_HERE,
base::BindOnce(&NativeDesktopMediaList::UpdateNativeThumbnailsFinished,
media_list_));
+
+ // This call is necessary to release underlying OS screen capture mechanisms.
+ capturer_.reset();
}

void NativeDesktopMediaList::Worker::OnCaptureResult(
@@ -427,6 +431,11 @@ void NativeDesktopMediaList::RefreshForVizFrameSinkWindows(
FROM_HERE, base::BindOnce(&Worker::RefreshThumbnails,
base::Unretained(worker_.get()),
std::move(native_ids), thumbnail_size_));
Expand Down

0 comments on commit 679c979

Please sign in to comment.