diff options
author | Julian Rex <julian.rex@mapbox.com> | 2019-04-16 13:02:14 -0400 |
---|---|---|
committer | Julian Rex <julian.rex@mapbox.com> | 2019-04-16 13:02:14 -0400 |
commit | 77f43ff06272c64276304ef8f305f2954b945d76 (patch) | |
tree | 4b46562a7c613be03e50e5d191540cabce6a7be1 | |
parent | 70603dc17f333078c290d32c3852756bb7077104 (diff) | |
download | qtlocation-mapboxgl-upstream/jrex/display-link-rendering-updates.tar.gz |
[ios] Ensure display link is created at launch.upstream/jrex/display-link-rendering-updates
-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]; } } |