Bug 1129696 - Added missing retain/release on NSTimer. r=dougt

This commit is contained in:
Garvan Keeley 2015-02-04 16:00:00 +01:00
Родитель 83c3bcea0a
Коммит c83256046f
1 изменённых файлов: 4 добавлений и 5 удалений

Просмотреть файл

@ -58,14 +58,13 @@ static const CLLocationAccuracy kDEFAULT_ACCURACY = kCLLocationAccuracyNearestTe
} }
[mHandoffTimer invalidate]; [mHandoffTimer invalidate];
[mHandoffTimer release];
mHandoffTimer = nil; mHandoffTimer = nil;
} }
- (void)handoffToGeoIPProvider - (void)handoffToGeoIPProvider
{ {
// Single-shot timers are invalid once executed and are released by the run loop [self shutdownHandoffTimer];
mHandoffTimer = nil;
mProvider->CreateMLSFallbackProvider(); mProvider->CreateMLSFallbackProvider();
} }
@ -96,11 +95,11 @@ static const CLLocationAccuracy kDEFAULT_ACCURACY = kCLLocationAccuracyNearestTe
// The 2 sec delay is arbitrarily large enough that CL has a reasonable head start and // The 2 sec delay is arbitrarily large enough that CL has a reasonable head start and
// if it is likely to succeed, it should complete before the MLS provider. // if it is likely to succeed, it should complete before the MLS provider.
// Take note that in locationManager:didUpdateLocations: the handoff to MLS is stopped. // Take note that in locationManager:didUpdateLocations: the handoff to MLS is stopped.
mHandoffTimer = [NSTimer scheduledTimerWithTimeInterval:2.0 mHandoffTimer = [[NSTimer scheduledTimerWithTimeInterval:2.0
target:self target:self
selector:@selector(handoffToGeoIPProvider) selector:@selector(handoffToGeoIPProvider)
userInfo:nil userInfo:nil
repeats:NO]; repeats:NO] retain];
} }
} }