From 77f43ff06272c64276304ef8f305f2954b945d76 Mon Sep 17 00:00:00 2001 From: Julian Rex Date: Tue, 16 Apr 2019 13:02:14 -0400 Subject: [ios] Ensure display link is created at launch. --- platform/ios/src/MGLMapView.mm | 16 ++++++++++++---- 1 file 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]; } } -- cgit v1.2.1