File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -322,15 +322,22 @@ extension AppleMapController {
322
322
snapShot? . cancel ( )
323
323
324
324
if #available( iOS 10 . 0 , * ) {
325
- snapShot? . start { [ unowned self] snapshot, error in
325
+ snapShot? . start { [ weak self] snapshot, error in
326
+ guard let self = self else {
327
+ return
328
+ }
329
+
326
330
guard let snapshot = snapshot, error == nil else {
327
331
onCompletion ( nil , error)
328
332
return
329
333
}
330
-
331
- let image = UIGraphicsImageRenderer ( size: self . snapShotOptions. size) . image { context in
334
+
335
+ let image = UIGraphicsImageRenderer ( size: self . snapShotOptions. size) . image { [ weak self] context in
336
+ guard let self = self else {
337
+ return
338
+ }
332
339
snapshot. image. draw ( at: . zero)
333
- let rect = snapShotOptions. mapRect
340
+ let rect = self . snapShotOptions. mapRect
334
341
if options. showAnnotations {
335
342
for annotation in self . mapView. getMapViewAnnotations ( ) {
336
343
self . drawAnnotations ( annotation: annotation, point: snapshot. point ( for: annotation!. coordinate) )
You can’t perform that action at this time.
0 commit comments