Skip to content

Commit

Permalink
fix(ios): dangling pointer in HippyBridge when unload after invalidate
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwcg committed Jun 4, 2024
1 parent 04d186c commit 7bf5d5a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions framework/ios/base/bridge/HippyBridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -677,8 +677,9 @@ - (void)unloadInstanceForRootView:(NSNumber *)rootTag {
NSDictionary *param = @{@"id": rootTag};
footstone::value::HippyValue value = [param toHippyValue];
std::shared_ptr<footstone::value::HippyValue> domValue = std::make_shared<footstone::value::HippyValue>(value);
self.javaScriptExecutor.pScope->UnloadInstance(domValue);

if (self.javaScriptExecutor) {
self.javaScriptExecutor.pScope->UnloadInstance(domValue);
}
_renderManager->UnregisterRootView([rootTag intValue]);
if (_rootNode) {
_rootNode->ReleaseResources();
Expand Down Expand Up @@ -1115,7 +1116,6 @@ - (void)invalidate {
id jsExecutor = _javaScriptExecutor;
id moduleSetup = _moduleSetup;
_displayLink = nil;
_javaScriptExecutor = nil;
_moduleSetup = nil;
_startTime = footstone::TimePoint::SystemNow();
self.moduleSemaphore = nil;
Expand Down

0 comments on commit 7bf5d5a

Please sign in to comment.