Destroy node environment when a JS context in renderer is destroyed

This commit is contained in:
Cheng Zhao 2017-03-02 16:49:39 +09:00
parent d379b05890
commit 29278e500b

View file

@ -381,6 +381,9 @@ void AtomRendererClient::WillReleaseScriptContext(
node::Environment* env = node::Environment::GetCurrent(context);
if (env)
mate::EmitEvent(env->isolate(), env->process_object(), "exit");
// Destroy the node environment.
node::FreeEnvironment(env);
}
bool AtomRendererClient::ShouldFork(blink::WebLocalFrame* frame,