From 11886a9004e03a5fb360ae7ad766f85754f2a253 Mon Sep 17 00:00:00 2001 From: Brad Leege Date: Fri, 8 May 2015 10:21:00 -0500 Subject: [PATCH] #1474 - Adding timer cleanup logic to -flush so that it doesn't loop indefinitely --- platform/ios/MGLMapboxEvents.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m index b5a219546..c4d6d425c 100644 --- a/platform/ios/MGLMapboxEvents.m +++ b/platform/ios/MGLMapboxEvents.m @@ -429,6 +429,13 @@ NSString *const MGLEventGestureRotateStart = @"Rotation"; // Send Array of Events to Server [strongSelf postEvents:events]; + + // Cancel Any Timer That May Running + if (strongSelf.timer) { + NSLog(@"timer still exists after flush, need to clean it up."); + [strongSelf.timer invalidate]; + strongSelf.timer = nil; + } }); }