Skip to content

Commit 53459a0

Browse files
authored
Wrap _listeners access with _realtimeLockQueue in fetchLatestConfig completionHandler (#13776)
1 parent eb5e301 commit 53459a0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

FirebaseRemoteConfig/Sources/RCNConfigRealtime.m

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,10 +462,12 @@ - (void)fetchLatestConfig:(NSInteger)remainingAttempts targetVersion:(NSInteger)
462462
integerValue] >= targetVersion) {
463463
// only notify listeners if there is a change
464464
if ([update updatedKeys].count > 0) {
465-
for (RCNConfigUpdateCompletion listener in strongSelf
466-
->_listeners) {
467-
listener(update, nil);
468-
}
465+
dispatch_async(strongSelf->_realtimeLockQueue, ^{
466+
for (RCNConfigUpdateCompletion listener in strongSelf
467+
->_listeners) {
468+
listener(update, nil);
469+
}
470+
});
469471
}
470472
} else {
471473
FIRLogDebug(

0 commit comments

Comments
 (0)