Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ios): null pointer exception of bridge setup in rare scenarios #4016

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading