Skip to content

Commit e83bd9b

Browse files
trop[bot]poirunornagonelectron-bot
authored
fix: Avoid crashing in NativeViewHost::SetParentAccessible on Windows 10 (#26950)
* fix: Avoid crashing in NativeViewHost::SetParentAccessible on Windows This fixes #26905. The patch was obtained from @deepak1556, who in turn got it from the Microsoft Teams folks. I believe the crash started happening due to the changes in https://chromium.googlesource.com/chromium/src.git/+/5c6c8e994bce2bfb867279ae5068e9f9134e70c3%5E!/#F15 This affects Electron 9 and later. Notes: Fix occasional crash on Windows * Update .patches * update patches Co-authored-by: Biru Mohanathas <birunthan@mohanathas.com> Co-authored-by: Jeremy Rose <jeremya@chromium.org> Co-authored-by: Electron Bot <electron@github.com>
1 parent c2136b6 commit e83bd9b

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

patches/chromium/.patches

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,4 @@ cherry-pick-5ffbb7ed173a.patch
161161
propagate_disable-dev-shm-usage_to_child_processes.patch
162162
cherry-pick-bbc6ab5bb49c.patch
163163
cherry-pick-ecdec1fb0f42.patch
164+
fix_setparentacessibile_crash_win.patch
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Biru Mohanathas <birunthan@mohanathas.com>
3+
Date: Thu, 10 Dec 2020 19:02:37 +0200
4+
Subject: fix crash in NativeViewHost::SetParentAccessible
5+
6+
This fixes random crashes on Windows 10. It presumably started happening
7+
after the changes in
8+
https://chromium.googlesource.com/chromium/src.git/+/5c6c8e994bce2bfb867279ae5068e9f9134e70c3%5E!/#F15
9+
10+
For context, see: https://github.com/electron/electron/issues/26905
11+
12+
This patch can likely be upstreamed. The crash cannot be fixed without
13+
patching something in Chromium - this is the least invasive change.
14+
15+
diff --git a/ui/views/controls/native/native_view_host.cc b/ui/views/controls/native/native_view_host.cc
16+
index b29553ae8f7b0f8bff44bb74b725dab5d5b9fa59..f51fa29c6d76623d58c0f4eb633b26fdddc30d55 100644
17+
--- a/ui/views/controls/native/native_view_host.cc
18+
+++ b/ui/views/controls/native/native_view_host.cc
19+
@@ -54,6 +54,9 @@ void NativeViewHost::Detach() {
20+
}
21+
22+
void NativeViewHost::SetParentAccessible(gfx::NativeViewAccessible accessible) {
23+
+ if (!native_wrapper_.get())
24+
+ return;
25+
+
26+
native_wrapper_->SetParentAccessible(accessible);
27+
}
28+

0 commit comments

Comments
 (0)