fix: remove early capturer_.reset() that causes nullptr deref on next refresh#51787
Merged
Conversation
…xt refresh (electron#51329) fix: remove early capturer_.reset() that causes null deref on next refresh Another followup to dad4ab6: remove the `capturer_.reset()` that `desktop_media_list.patch` was adding `Worker::RefreshNextThumbnail()`. Since we switched from the one-shot Update() model to the continuous StartUpdating() model, resetting `capturer_` isn't necessary and is now dangerous: ScheduleNextRefresh() posts a delayed Worker::Refresh() that dereferences capturer_, causing a nullptr crash. Under CI load, the NativeDesktopMediaList can survive long enough for the next 1-second refresh cycle to fire before FinalizeList() destroys it. The crash can manifest as either a SIGSEGV or a DCHECK(can_refresh()) failure, which is extra fun because dad4ab6 was fixing a similar DCHECK crash in the first place. Sample crash: ``` [6690:0426/173732.876803:FATAL:chrome/browser/media/webrtc/native_desktop_media_list.cc:934] DCHECK failed: can_refresh().0x00000001337aa7f3 NativeDesktopMediaList::RefreshForVizFrameSinkWindows(...) + 131 ```
5 tasks
nikwen
approved these changes
May 27, 2026
dsanders11
approved these changes
May 28, 2026
jkleinsc
approved these changes
May 28, 2026
|
Release Notes Persisted
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #51329
See that PR for details. This commit was not backported as part of #51506, although the PR body mentions that it should:
Release Notes
Notes: Fixed a
desktopCapturercrash when sharing a window on Windows.