Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ios): delay release engine resource to avoid deadlock #4090

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(ios): delay release engine resource to avoid deadlock
  • Loading branch information
wwwcg committed Oct 23, 2024
commit 9b876693e491d1c344994d5e315899fb320c39d8
5 changes: 5 additions & 0 deletions framework/ios/base/executors/HippyJSExecutor.mm
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,12 @@ - (void)invalidate {
return;
}
dispatch_async(dispatch_get_main_queue(), ^{
auto engineRsc = [[HippyJSEnginesMapper defaultInstance] JSEngineResourceForKey:enginekey];
[[HippyJSEnginesMapper defaultInstance] removeEngineResourceForKey:enginekey];
dispatch_async(dispatch_get_main_queue(), ^{
// Make a tiny delay to ensure the engine resource is released on the main thread
HippyLogInfo(@"Remove EngineRsc, UseCount:%ld", engineRsc.use_count());
});
});
}

Expand Down
Loading