Skip to content

Commit 57ec2ec

Browse files
committed
fix: isolate dispose on app exit handling
1 parent 62dff97 commit 57ec2ec

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

NativeScript/runtime/Runtime.mm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@
4848

4949
Runtime::isolates_.erase(std::remove(Runtime::isolates_.begin(), Runtime::isolates_.end(), this->isolate_), Runtime::isolates_.end());
5050

51-
this->isolate_->Dispose();
52-
51+
if (![NSThread isMainThread]) {
52+
this->isolate_->Dispose();
53+
}
54+
5355
currentRuntime_ = nullptr;
5456
}
5557

0 commit comments

Comments
 (0)