Skip to content

Commit

Permalink
fix(ios): null pointer exception of bridge setup in rare scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwcg committed Sep 4, 2024
1 parent 90fdf95 commit 95ee14f
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 @@ -442,8 +442,9 @@ - (void)setUp {

_javaScriptExecutor.contextCreatedBlock = ^(){
__strong __typeof(weakSelf)strongSelf = weakSelf;
if (strongSelf) {
dispatch_semaphore_wait(strongSelf.moduleSemaphore, DISPATCH_TIME_FOREVER);
dispatch_semaphore_t moduleSemaphore = strongSelf.moduleSemaphore;
if (strongSelf.isValid && moduleSemaphore) {
dispatch_semaphore_wait(moduleSemaphore, DISPATCH_TIME_FOREVER);
NSDictionary *nativeModuleConfig = [strongSelf nativeModuleConfig];
[strongSelf.javaScriptExecutor injectObjectSync:nativeModuleConfig
asGlobalObjectNamed:kHippyBatchedBridgeConfigKey callback:nil];
Expand Down Expand Up @@ -1085,7 +1086,6 @@ - (void)invalidate {
_displayLink = nil;
_moduleSetup = nil;
_startTime = footstone::TimePoint::SystemNow();
self.moduleSemaphore = nil;

dispatch_group_notify(group, dispatch_get_main_queue(), ^{
[jsExecutor executeBlockOnJavaScriptQueue:^{
Expand Down

0 comments on commit 95ee14f

Please sign in to comment.