Merge pull request #6144 from electron/crash-release-renderer
Avoid calling Environment::GetCurrent for unjected contexts
This commit is contained in:
commit
6bd1a2dec6
1 changed files with 5 additions and 0 deletions
|
@ -282,6 +282,11 @@ void AtomRendererClient::DidCreateScriptContext(
|
||||||
|
|
||||||
void AtomRendererClient::WillReleaseScriptContext(
|
void AtomRendererClient::WillReleaseScriptContext(
|
||||||
v8::Handle<v8::Context> context, content::RenderFrame* render_frame) {
|
v8::Handle<v8::Context> context, content::RenderFrame* render_frame) {
|
||||||
|
// Only allow node integration for the main frame, unless it is a devtools
|
||||||
|
// extension page.
|
||||||
|
if (!render_frame->IsMainFrame() && !IsDevToolsExtension(render_frame))
|
||||||
|
return;
|
||||||
|
|
||||||
node::Environment* env = node::Environment::GetCurrent(context);
|
node::Environment* env = node::Environment::GetCurrent(context);
|
||||||
if (env)
|
if (env)
|
||||||
mate::EmitEvent(env->isolate(), env->process_object(), "exit");
|
mate::EmitEvent(env->isolate(), env->process_object(), "exit");
|
||||||
|
|
Loading…
Reference in a new issue