Skip to content

Commit 4923cdc

Browse files
authored
fix: create handle scope with proper isolate (#77) (#78)
1 parent 673a92b commit 4923cdc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

NativeScript/runtime/Interop.mm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@
4141
Isolate::Scope isolate_scope(runtimeIsolate);
4242
HandleScope handle_scope(runtimeIsolate);
4343
Local<Value> callback = wrapper->callback_->Get(runtimeIsolate);
44-
if (!callback.IsEmpty() && callback->IsObject()) {
45-
Local<Context> context = callback.As<Object>()->CreationContext();
46-
Isolate* isolate = context->GetIsolate();
44+
Isolate* isolate = wrapper->isolate_;
45+
if (Runtime::IsAlive(isolate) && !callback.IsEmpty() && callback->IsObject()) {
4746
v8::Locker locker(isolate);
4847
Isolate::Scope isolate_scope(isolate);
4948
HandleScope handle_scope(isolate);

0 commit comments

Comments
 (0)