Fix render-view-deleted being emitted twice
This commit is contained in:
parent
6753fcc1b4
commit
96b2705bd3
1 changed files with 1 additions and 3 deletions
|
@ -296,6 +296,7 @@ WebContents::~WebContents() {
|
||||||
// The WebContentsDestroyed will not be called automatically because we
|
// The WebContentsDestroyed will not be called automatically because we
|
||||||
// unsubscribe from webContents before destroying it. So we have to manually
|
// unsubscribe from webContents before destroying it. So we have to manually
|
||||||
// call it here to make sure "destroyed" event is emitted.
|
// call it here to make sure "destroyed" event is emitted.
|
||||||
|
RenderViewDeleted(web_contents()->GetRenderViewHost());
|
||||||
WebContentsDestroyed();
|
WebContentsDestroyed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -665,9 +666,6 @@ bool WebContents::OnMessageReceived(const IPC::Message& message) {
|
||||||
// be destroyed on close, and WebContentsDestroyed would be called for it, so
|
// be destroyed on close, and WebContentsDestroyed would be called for it, so
|
||||||
// we need to make sure the api::WebContents is also deleted.
|
// we need to make sure the api::WebContents is also deleted.
|
||||||
void WebContents::WebContentsDestroyed() {
|
void WebContents::WebContentsDestroyed() {
|
||||||
// The RenderViewDeleted was not called when the WebContents is destroyed.
|
|
||||||
RenderViewDeleted(web_contents()->GetRenderViewHost());
|
|
||||||
|
|
||||||
// This event is only for internal use, which is emitted when WebContents is
|
// This event is only for internal use, which is emitted when WebContents is
|
||||||
// being destroyed.
|
// being destroyed.
|
||||||
Emit("will-destroy");
|
Emit("will-destroy");
|
||||||
|
|
Loading…
Reference in a new issue