#1474 - Adding timer cleanup logic to -flush so that it doesn't loop indefinitely

This commit is contained in:
Brad Leege
2015-05-08 10:21:00 -05:00
parent ea3979b19e
commit 11886a9004

View File

@@ -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;
}
});
}