Commit 4dc6f4ad authored by Ben Noordhuis's avatar Ben Noordhuis Committed by Timothy J Fontaine
Browse files

src: fix MakeCallback() handle leak

Create a new HandleScope before looking up the object context with
v8::Object::CreationContext(), else we leak the Local<Context> into
the current HandleScope.

That's relatively harmless unless the HandleScope is long-lived and
MakeCallback() is called a lot.  In a scenario like that, we may end
up leaking a lot of memory.

What is unfortunate about this change is that we're trying hard to
eradicate the node_isolate global.  Longer term, we will probably have
to change the MakeCallback() prototype to one that requires an explicit
v8::Isolate* argument.
parent 1f2f3fa8
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment