diff options
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 6fc859511a..bcf3bc7ed6 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -1714,11 +1714,19 @@ public: // Only restart the display link if we're not hidden // self.displayLink.paused = ![self displayLinkShouldRun]; - MGLAssert(self.displayLink, @""); - - if ([self mapViewIsVisible]) + if (self.displayLink) + { + if ([self mapViewIsVisible]) + { + [self startDisplayLink]; + } + } + else { - [self startDisplayLink]; + // This is required since at the start of the application, didMoveToWindow + // can be called when still in an inactive state. In this case, we haven't + // had an opportunity to create the display link, so create it here. + [self validateDisplayLink]; } } |