summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Rex <julian.rex@mapbox.com>2019-04-30 16:11:14 -0400
committerGitHub <noreply@github.com>2019-04-30 16:11:14 -0400
commitb15b78346fe44afbdb81934606ab63252df96b66 (patch)
tree904d057fec70968148015996022284b62a73ff61
parent0fcab654a13bde881ba20ca4cd7ac3a6ae47677c (diff)
downloadqtlocation-mapboxgl-b15b78346fe44afbdb81934606ab63252df96b66.tar.gz
[ios] Check for valid superview to avoid crash on iOS 9 (#14529)
-rw-r--r--platform/ios/CHANGELOG.md1
-rw-r--r--platform/ios/src/MGLMapView.mm5
2 files changed, 5 insertions, 1 deletions
diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md
index 0269d20041..d3f6a7b5fb 100644
--- a/platform/ios/CHANGELOG.md
+++ b/platform/ios/CHANGELOG.md
@@ -8,6 +8,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT
* Fix a bug that wrong position of attribution dialog after rotation. ([#14185](https://github.com/mapbox/mapbox-gl-native/pull/14185))
* Fixed a bug with jittery callout views when using sprite-based annotations. ([#14445](https://github.com/mapbox/mapbox-gl-native/pull/14445))
* Improved `MGLLocationManager` optional protocol properties briding to Swift. ([#14477](https://github.com/mapbox/mapbox-gl-native/pull/14477))
+* Fixed a layout constraints crash on iOS 9 when a view is removed from its superview. ([#14529](https://github.com/mapbox/mapbox-gl-native/pull/14529))
## 4.10.0 - April 17, 2019
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index cadf5be3fd..345ac64bc7 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -1377,7 +1377,10 @@ public:
- (void)didMoveToSuperview
{
[self validateDisplayLink];
- [self installConstraints];
+ if (self.superview)
+ {
+ [self installConstraints];
+ }
[super didMoveToSuperview];
}