Skip to content

Commit daaa72d

Browse files
authored
fix(storage, ios): dont enumerate on dictionary being mutated (#5455)
Avoid a possible crash during storage dealloc by iterating on a copy of the array being mutated instead of the array itself
1 parent 0d26af9 commit daaa72d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/storage/ios/RNFBStorage/RNFBStorageModule.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ - (id)init {
6161
}
6262

6363
- (void)dealloc {
64-
for (NSString *key in PENDING_TASKS) {
64+
for (NSString *key in [PENDING_TASKS allKeys]) {
6565
[PENDING_TASKS removeObjectForKey:key];
6666
}
6767
}
6868

6969
- (void)invalidate {
70-
for (NSString *key in PENDING_TASKS) {
70+
for (NSString *key in [PENDING_TASKS allKeys]) {
7171
[PENDING_TASKS removeObjectForKey:key];
7272
}
7373
}

0 commit comments

Comments
 (0)