mirror of
https://github.com/electron/electron.git
synced 2026-01-10 07:58:08 -05:00
fix: crash on source capture with empty thumbnail size (#47641)
This commit is contained in:
@@ -236,7 +236,8 @@ DesktopCapturer::DesktopListListener::~DesktopListListener() = default;
|
||||
|
||||
void DesktopCapturer::DesktopListListener::OnDelegatedSourceListSelection() {
|
||||
if (have_thumbnail_) {
|
||||
std::move(update_callback_).Run();
|
||||
content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
|
||||
std::move(update_callback_));
|
||||
} else {
|
||||
have_selection_ = true;
|
||||
}
|
||||
@@ -249,7 +250,8 @@ void DesktopCapturer::DesktopListListener::OnSourceThumbnailChanged(int index) {
|
||||
have_selection_ = false;
|
||||
|
||||
// PipeWire returns a single source, so index is not relevant.
|
||||
std::move(update_callback_).Run();
|
||||
content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
|
||||
std::move(update_callback_));
|
||||
} else {
|
||||
have_thumbnail_ = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user