summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Rex <julian.rex@mapbox.com>2019-04-16 13:02:14 -0400
committerJulian Rex <julian.rex@mapbox.com>2019-04-16 13:02:14 -0400
commit77f43ff06272c64276304ef8f305f2954b945d76 (patch)
tree4b46562a7c613be03e50e5d191540cabce6a7be1
parent70603dc17f333078c290d32c3852756bb7077104 (diff)
downloadqtlocation-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.mm16
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];
}
}