mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: check WebContents before emitting render-process-gone event (#27730)
This commit is contained in:
@@ -1407,7 +1407,13 @@ void WebContents::RenderViewDeleted(content::RenderViewHost* render_view_host) {
|
||||
}
|
||||
|
||||
void WebContents::RenderProcessGone(base::TerminationStatus status) {
|
||||
auto weak_this = GetWeakPtr();
|
||||
Emit("crashed", status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED);
|
||||
|
||||
// User might destroy WebContents in the crashed event.
|
||||
if (!weak_this)
|
||||
return;
|
||||
|
||||
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
gin_helper::Dictionary details = gin_helper::Dictionary::CreateEmpty(isolate);
|
||||
|
||||
Reference in New Issue
Block a user