Skip to content

Commit

Permalink
Wrap _listeners access with _realtimeLockQueue in fetchLatestConfig c…
Browse files Browse the repository at this point in the history
…ompletionHandler (#13776)
  • Loading branch information
yanz-safe authored Oct 5, 2024
1 parent eb5e301 commit 53459a0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions FirebaseRemoteConfig/Sources/RCNConfigRealtime.m
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,12 @@ - (void)fetchLatestConfig:(NSInteger)remainingAttempts targetVersion:(NSInteger)
integerValue] >= targetVersion) {
// only notify listeners if there is a change
if ([update updatedKeys].count > 0) {
for (RCNConfigUpdateCompletion listener in strongSelf
->_listeners) {
listener(update, nil);
}
dispatch_async(strongSelf->_realtimeLockQueue, ^{
for (RCNConfigUpdateCompletion listener in strongSelf
->_listeners) {
listener(update, nil);
}
});
}
} else {
FIRLogDebug(
Expand Down

0 comments on commit 53459a0

Please sign in to comment.