Skip to content

Commit 3862a56

Browse files
authored
Fix RTDB race condition (#9973)
1 parent d5637c4 commit 3862a56

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

FirebaseDatabase/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 9.3.0
2+
- [fixed] Fix `reference(withPath:)` race condition crash. (#7885)
3+
14
# 8.12.0
25
- [fixed] **Breaking change:** Mark `getData()` snapshot as nullable to fix Swift API. (#9655)
36

FirebaseDatabase/Sources/Api/FIRDatabase.m

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,12 @@ - (void)assertUnfrozen:(NSString *)methodName {
249249
}
250250

251251
- (void)ensureRepo {
252-
if (self.repo == nil) {
253-
self.repo = [FRepoManager createRepo:self.repoInfo
254-
config:self.config
255-
database:self];
252+
@synchronized(self) {
253+
if (self.repo == nil) {
254+
self.repo = [FRepoManager createRepo:self.repoInfo
255+
config:self.config
256+
database:self];
257+
}
256258
}
257259
}
258260

0 commit comments

Comments
 (0)