Free the node environment when releasing context.
This commit is contained in:
parent
df0094b6cb
commit
980e8ca4dc
1 changed files with 11 additions and 3 deletions
|
@ -57,9 +57,17 @@ void AtomRendererClient::DidCreateScriptContext(WebKit::WebFrame* frame,
|
||||||
atom_bindings_->BindToFrame(frame);
|
atom_bindings_->BindToFrame(frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AtomRendererClient::WillReleaseScriptContext(WebKit::WebFrame* frame,
|
void AtomRendererClient::WillReleaseScriptContext(
|
||||||
v8::Handle<v8::Context>,
|
WebKit::WebFrame* frame,
|
||||||
int world_id) {
|
v8::Handle<v8::Context> context,
|
||||||
|
int world_id) {
|
||||||
|
node::Environment* env = node::Environment::GetCurrent(context);
|
||||||
|
if (env == NULL) {
|
||||||
|
LOG(ERROR) << "Encounter a non-node context when releasing script context";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
env->Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
Loading…
Reference in a new issue