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 13, 2024
1 parent 7e6908d commit 76ca98f
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 @@ -680,8 +680,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 @@ -1118,7 +1119,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 76ca98f

Please sign in to comment.