Skip to content

Commit

Permalink
Fix synchronized wrong object while manipulating appColdStartSubscrib…
Browse files Browse the repository at this point in the history
…ers (firebase#3992)
  • Loading branch information
Knight-ZXW authored Aug 29, 2022
1 parent a50da9f commit 3f13291
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public void unregisterForAppState(WeakReference<AppStateCallback> subscriber) {
* @param subscriber the {@link AppColdStartCallback} instance.
*/
public void registerForAppColdStart(AppColdStartCallback subscriber) {
synchronized (appStateSubscribers) {
synchronized (appColdStartSubscribers) {
appColdStartSubscribers.add(subscriber);
}
}
Expand All @@ -315,7 +315,7 @@ private void updateAppState(ApplicationProcessState newState) {

/** Send cold start update to registered subscribers. */
private void sendAppColdStartUpdate() {
synchronized (appStateSubscribers) {
synchronized (appColdStartSubscribers) {
for (Iterator<AppColdStartCallback> i = appColdStartSubscribers.iterator(); i.hasNext(); ) {
AppColdStartCallback callback = i.next();
if (callback != null) {
Expand Down

0 comments on commit 3f13291

Please sign in to comment.