mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
chore: debug crash on DevTools SetOwnerWindow (#47243)
This commit is contained in:
@@ -2147,8 +2147,11 @@ void WebContents::DevToolsOpened() {
|
||||
// Inherit owner window in devtools when it doesn't have one.
|
||||
auto* devtools = inspectable_web_contents_->GetDevToolsWebContents();
|
||||
bool has_window = devtools->GetUserData(NativeWindowRelay::UserDataKey());
|
||||
if (owner_window() && !has_window)
|
||||
if (owner_window_ && !has_window) {
|
||||
DCHECK(!owner_window_.WasInvalidated());
|
||||
DCHECK_EQ(handle->owner_window(), nullptr);
|
||||
handle->SetOwnerWindow(devtools, owner_window());
|
||||
}
|
||||
|
||||
Emit("devtools-opened");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user