mirror of
https://github.com/electron/electron.git
synced 2026-01-29 09:18:18 -05:00
Fix crash when closing docked devtools by clicking close button.
We need to send ack for the close message, so we should destroy web contents after the beforeunload event has fired.
This commit is contained in:
@@ -176,7 +176,7 @@ void InspectableWebContentsImpl::ActivateWindow() {
|
||||
}
|
||||
|
||||
void InspectableWebContentsImpl::CloseWindow() {
|
||||
CloseDevTools();
|
||||
devtools_web_contents()->GetMainFrame()->DispatchBeforeUnload(false);
|
||||
}
|
||||
|
||||
void InspectableWebContentsImpl::SetContentsResizingStrategy(
|
||||
@@ -305,4 +305,8 @@ void InspectableWebContentsImpl::HandleKeyboardEvent(
|
||||
delegate->HandleKeyboardEvent(source, event);
|
||||
}
|
||||
|
||||
void InspectableWebContentsImpl::CloseContents(content::WebContents* source) {
|
||||
CloseDevTools();
|
||||
}
|
||||
|
||||
} // namespace brightray
|
||||
|
||||
@@ -109,6 +109,7 @@ class InspectableWebContentsImpl :
|
||||
|
||||
virtual void HandleKeyboardEvent(
|
||||
content::WebContents*, const content::NativeWebKeyboardEvent&) OVERRIDE;
|
||||
virtual void CloseContents(content::WebContents* source) OVERRIDE;
|
||||
|
||||
scoped_ptr<content::WebContents> web_contents_;
|
||||
scoped_ptr<content::DevToolsClientHost> frontend_host_;
|
||||
|
||||
Reference in New Issue
Block a user