Skip to content

Commit b08b0bd

Browse files
author
Olle Fredriksson
committed
Use the localExternal when creating JSExternals
Otherwise we might prematurely free Externals, since the object with the finalizer has nothing to do with the object managed by the JSExternal.
1 parent a36ffbc commit b08b0bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

V8Simple.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ DllPublic JSExternal* CDecl CreateJSExternal(JSContext* context, void* value)
946946
},
947947
v8::WeakCallbackType::kParameter);
948948

949-
return new JSExternal(context->Isolate, v8::External::New(context->Isolate, value));
949+
return new JSExternal(context->Isolate, localExternal);
950950
}
951951

952952
DllPublic void* CDecl GetJSExternalValue(JSContext* context, JSExternal* external)

0 commit comments

Comments
 (0)