Skip to content

Commit

Permalink
fix(ios): delay release engine resource to avoid deadlock (#4090)
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwcg committed Oct 24, 2024
1 parent ca3967f commit 2d07005
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 2d07005

Please sign in to comment.