Skip to content

Commit f527153

Browse files
committed
fix(database, android): remove RTDB listeners before shutting down executors
Call super.invalidate() only after clearing query listeners so Firebase callbacks are less likely to run against a shut-down TaskExecutorService, matching the Firestore module invalidation order.
1 parent d0c6513 commit f527153

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/database/android/src/reactnative/java/io/invertase/firebase/database/ReactNativeFirebaseDatabaseQueryModule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ public class ReactNativeFirebaseDatabaseQueryModule extends ReactNativeFirebaseM
4343

4444
@Override
4545
public void invalidate() {
46-
super.invalidate();
47-
4846
Iterator refIterator = queryMap.entrySet().iterator();
4947
while (refIterator.hasNext()) {
5048
Map.Entry pair = (Map.Entry) refIterator.next();
@@ -53,6 +51,8 @@ public void invalidate() {
5351
databaseQuery.removeAllEventListeners();
5452
refIterator.remove(); // avoids a ConcurrentModificationException
5553
}
54+
55+
super.invalidate();
5656
}
5757

5858
/**

0 commit comments

Comments
 (0)