Переглянути джерело

Wrap _listeners access with _realtimeLockQueue in fetchLatestConfig completionHandler (#13776)

Yan Zaitsev 1 рік тому
батько
коміт
53459a0c76
1 змінених файлів з 6 додано та 4 видалено
  1. 6 4
      FirebaseRemoteConfig/Sources/RCNConfigRealtime.m

+ 6 - 4
FirebaseRemoteConfig/Sources/RCNConfigRealtime.m

@@ -462,10 +462,12 @@ static NSInteger const gMaxRetries = 7;
                                                   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(