Skip to content

Commit

Permalink
Changed order of timer invalidation (#59)
Browse files Browse the repository at this point in the history
* Changed order of timer invalidation

Co-Authored-By: Julian Rex <[email protected]>
  • Loading branch information
rclee and julianrex authored Aug 17, 2018
1 parent dd7dafa commit fad77a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion MapboxMobileEvents/MMELocationManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,10 @@ - (void)timeoutAllowedCheck {
}

- (void)startBackgroundTimeoutTimer {
[self.backgroundLocationServiceTimeoutTimer invalidate];
NSTimer *tempTimer = self.backgroundLocationServiceTimeoutTimer;
self.backgroundLocationServiceTimeoutAllowedDate = [[NSDate date] dateByAddingTimeInterval:MMELocationManagerHibernationTimeout];
self.backgroundLocationServiceTimeoutTimer = [NSTimer scheduledTimerWithTimeInterval:MMELocationManagerHibernationPollInterval target:self selector:@selector(timeoutAllowedCheck) userInfo:nil repeats:YES];
[tempTimer invalidate];
}

- (void)establishRegionMonitoringForLocation:(CLLocation *)location {
Expand Down

0 comments on commit fad77a7

Please sign in to comment.