diff options
author | Fabian Guerra Soto <fabian.guerra@mapbox.com> | 2018-02-12 16:47:16 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-12 16:47:16 -0500 |
commit | 024e75bd560cdf2be58322e127f92c81f06cfe0c (patch) | |
tree | 8ab716d8bd16ec65c4ca698935afe998a4ee258e /platform/ios/app/MBXSnapshotsViewController.m | |
parent | 9ee99c91bbf995302ead77a3f6fa22443f50a910 (diff) | |
download | qtlocation-mapboxgl-024e75bd560cdf2be58322e127f92c81f06cfe0c.tar.gz |
[ios, macos] Fix memory leaks in MGLMapSnapshotter. (#11133)
Diffstat (limited to 'platform/ios/app/MBXSnapshotsViewController.m')
-rw-r--r-- | platform/ios/app/MBXSnapshotsViewController.m | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/platform/ios/app/MBXSnapshotsViewController.m b/platform/ios/app/MBXSnapshotsViewController.m index 3bf93d8721..95d3251e2e 100644 --- a/platform/ios/app/MBXSnapshotsViewController.m +++ b/platform/ios/app/MBXSnapshotsViewController.m @@ -50,12 +50,13 @@ options.zoomLevel = 10; // Create and start the snapshotter + __weak UIImageView *weakImageView = imageView; MGLMapSnapshotter* snapshotter = [[MGLMapSnapshotter alloc] initWithOptions:options]; [snapshotter startWithCompletionHandler: ^(MGLMapSnapshot* snapshot, NSError *error) { if (error) { NSLog(@"Could not load snapshot: %@", [error localizedDescription]); } else { - imageView.image = snapshot.image; + weakImageView.image = snapshot.image; } }]; |