Skip to content

Commit d5b9020

Browse files
committed
SDK-1831 add a lock, just in case
1 parent 5c5f313 commit d5b9020

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

BranchSDK/Branch.m

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2182,11 +2182,14 @@ - (void)initSafetyCheck {
21822182
}
21832183

21842184
- (void)initUserSessionAndCallCallback:(BOOL)callCallback sceneIdentifier:(NSString *)sceneIdentifier {
2185-
// Ignore lifecycle calls while init is deferred to a plugin runtime.
2186-
if (self.deferInitForPluginRuntime) {
2187-
//NSString *debug = [NSString stringWithFormat:@"Init is deferred, ignoring call: %@", NSThread.callStackSymbols];
2188-
//BNCLogDebug(debug);
2189-
return;
2185+
2186+
// ignore lifecycle calls while waiting for a plugin runtime.
2187+
@synchronized (self) {
2188+
if (self.deferInitForPluginRuntime) {
2189+
//NSString *debug = [NSString stringWithFormat:@"Init is deferred, ignoring call: %@", NSThread.callStackSymbols];
2190+
//BNCLogDebug(debug);
2191+
return;
2192+
}
21902193
}
21912194

21922195
dispatch_async(self.isolationQueue, ^(){

0 commit comments

Comments
 (0)