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;