Skip to content

Commit

Permalink
Fix race b/w resetting _bgMonitor to nil and using it
Browse files Browse the repository at this point in the history
* There is a race condition between resetting _bgMonitor to nil in -endBackground on the replicator thread and accessing _bgMonitor in -okToEndBackgrounding on the main thread.

* The easiest way to fix this is to not resetting nil after stopping the bgMonitor given the fact that it could also be recreated again from the replicator thread in the -setupBackgrounding method.

#1677 #CBSE-4145
  • Loading branch information
pasin committed Aug 28, 2017
1 parent a8b95b8 commit fd208f5
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion Source/CBLRestReplicator+Backgrounding.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ - (void) endBackgrounding {
name: UIApplicationProtectedDataDidBecomeAvailable
object: nil];
[_bgMonitor stop];
_bgMonitor = nil;
}


Expand Down

0 comments on commit fd208f5

Please sign in to comment.