Skip to content

Commit

Permalink
fix(ios): delay release engine resource to avoid deadlock (Tencent#4090)
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwcg committed Oct 24, 2024
1 parent 01d9201 commit 80437fd
Showing 1 changed file with 5 additions and 0 deletions.
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

0 comments on commit 80437fd

Please sign in to comment.