Skip to content

Commit

Permalink
fix(core): fix multi-context mode exception handling crash
Browse files Browse the repository at this point in the history
(cherry picked from commit 1fa36f8)
  • Loading branch information
churchill-zhang committed Mar 9, 2022
1 parent c035cc7 commit 0851998
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 0 additions & 2 deletions android/sdk/src/main/jni/src/bridge/entry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,6 @@ void DestroyInstance(__unused JNIEnv* j_env,
#else
runtime->GetScope()->WillExit();
#endif
TDF_BASE_LOG(INFO) << "SetScope nullptr";
runtime->SetScope(nullptr);
TDF_BASE_LOG(INFO) << "erase runtime";
Runtime::Erase(runtime);
TDF_BASE_LOG(INFO) << "js destroy end";
Expand Down
3 changes: 3 additions & 0 deletions android/sdk/src/main/jni/src/bridge/runtime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ std::shared_ptr<Runtime> Runtime::Find(v8::Isolate *isolate) {
continue;
}
std::shared_ptr<V8Ctx> ctx = std::static_pointer_cast<V8Ctx>(scope->GetContext());
if (!ctx) {
continue;
}
if (ctx->context_persistent_ == context) {
return p.second;
}
Expand Down

0 comments on commit 0851998

Please sign in to comment.