From 44caf2c7a97bc3b1314cc88dbf2c66ddaf5da2b0 Mon Sep 17 00:00:00 2001 From: Brad Leege Date: Wed, 20 May 2015 14:18:39 -0500 Subject: [PATCH] #1595 - Improving stability by moving MGLEventTypeAppUserTurnstile after the strongSelf check --- platform/ios/MGLMapboxEvents.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m index 364a05180..6b15df145 100644 --- a/platform/ios/MGLMapboxEvents.m +++ b/platform/ios/MGLMapboxEvents.m @@ -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;