summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin R. Miller <incanus@codesorcery.net>2015-03-26 23:00:57 -0700
committerJustin R. Miller <incanus@codesorcery.net>2015-03-26 23:00:57 -0700
commit29cd6b49789cb4b39beb107e4721948dc9c2cfa4 (patch)
treed6d68372ec918cf82481ddc77af19c90b3cd932e
parent0350216d3437471bc5c1a937c734ef0c3d05307c (diff)
downloadqtlocation-mapboxgl-29cd6b49789cb4b39beb107e4721948dc9c2cfa4.tar.gz
convention cleanups for main thread variable; use class method
-rw-r--r--platform/ios/MGLMapboxEvents.m13
1 files changed, 8 insertions, 5 deletions
diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m
index 5ecbbb6d2b..39470a97ff 100644
--- a/platform/ios/MGLMapboxEvents.m
+++ b/platform/ios/MGLMapboxEvents.m
@@ -55,7 +55,6 @@ NSString *const MGLEventMapLocation = @"Location";
@property (atomic) NSString *iOSVersion;
@property (atomic) NSString *carrier;
@property (atomic) NSUInteger flushAt;
-@property (atomic) NSTimeInterval flushAfter;
@property (atomic) NSDateFormatter *rfc3339DateFormatter;
@property (atomic) CGFloat scale;
@@ -63,6 +62,10 @@ NSString *const MGLEventMapLocation = @"Location";
//
@property (nonatomic) NSTimer *timer;
+// The flush expiration time is only ever accessed from the main thread.
+//
+@property (nonatomic) NSTimeInterval flushAfter;
+
// This is an array of events to push. All access to it will be
// from our own serial queue.
//
@@ -344,11 +347,11 @@ NSString *const MGLEventMapLocation = @"Location";
}
// Start New Timer
- NSTimeInterval interval = _flushAfter;
- _timer = [NSTimer scheduledTimerWithTimeInterval:interval
- target:self
+ _timer = [NSTimer scheduledTimerWithTimeInterval:_flushAfter
+ target:[self class]
selector:@selector(flush)
- userInfo:nil repeats:YES];
+ userInfo:nil
+ repeats:YES];
};
if ( ! [[NSThread currentThread] isMainThread]) {