I'm receiving the following message in XCode 10.2.1 after my ViewController with a MKMapView gets de-initialized.
[Memory] Resetting zone allocator with 24 allocations still alive
I'm using the following code in the ViewController to clean-up the MKMapView. It doesn't seem to matter if I do this or remove the delegate in the ViewDidDisappear event.
deinit {
self.mapView.delegate = nil
}
Is this indicating an actual memory leak or something else I need to fix? It doesn't appear to be leaking memory after opening/closing the ViewController multiple times.
Calling mapView.removeAnnotations(mapView.annotations)
in the deinit fixed it for me. It was occurring only if there were clustered annotations and the map was being zoomed or panned right before deallocation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With