Skip to content

Commit

Permalink
Fix RTDB race condition (#9973)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulb777 authored Jul 1, 2022
1 parent d5637c4 commit 3862a56
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions FirebaseDatabase/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 9.3.0
- [fixed] Fix `reference(withPath:)` race condition crash. (#7885)

# 8.12.0
- [fixed] **Breaking change:** Mark `getData()` snapshot as nullable to fix Swift API. (#9655)

Expand Down
10 changes: 6 additions & 4 deletions FirebaseDatabase/Sources/Api/FIRDatabase.m
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,12 @@ - (void)assertUnfrozen:(NSString *)methodName {
}

- (void)ensureRepo {
if (self.repo == nil) {
self.repo = [FRepoManager createRepo:self.repoInfo
config:self.config
database:self];
@synchronized(self) {
if (self.repo == nil) {
self.repo = [FRepoManager createRepo:self.repoInfo
config:self.config
database:self];
}
}
}

Expand Down

0 comments on commit 3862a56

Please sign in to comment.