#1595 - Improving stability by moving MGLEventTypeAppUserTurnstile after the strongSelf check

This commit is contained in:
Brad Leege
2015-05-20 14:18:39 -05:00
parent a5bd2fa3c6
commit 44caf2c7a9

View File

@@ -433,6 +433,10 @@ const NSTimeInterval MGLFlushInterval = 60;
dispatch_async(_serialQueue, ^{
MGLMapboxEvents *strongSelf = weakSelf;
if ( ! strongSelf) return;
if ([MGLEventTypeAppUserTurnstile isEqualToString:event]) {
// Build only IDFV event
NSString *vid = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
@@ -442,15 +446,11 @@ const NSTimeInterval MGLFlushInterval = 60;
[_eventQueue addObject:vevt];
// Flush
[MGLMapboxEvents flush];
[self flush];
return;
}
MGLMapboxEvents *strongSelf = weakSelf;
if ( ! strongSelf) return;
// Metrics Collection Has Been Paused
if (_paused) {
return;