hulab / ClusterKit

An iOS map clustering framework targeting MapKit, Google Maps and Mapbox.
MIT License
515 stars 86 forks source link

[CKCluster retain]: message sent to deallocated instance #65

Closed nnhubbard closed 5 years ago

nnhubbard commented 5 years ago

I am having an issue in Google Maps, sometimes when the delegate mapView:didTapMarker: is called and I access the .cluster property of the marker, I got a message and crash that the message was sent to a deallocated instance:

[CKCluster retain]: message sent to deallocated instance

Is there any reason why this might be happening and why the object has been deallocated?

maxep commented 5 years ago

The cluster property of GMSMarker is marked as weak but it's actually an assign. If you try to access it after the cluster list has changed, the cluster instance will be deallocated. Is there any reason the clusters list would change at this stage? do you have a snippet of your mapView:didTapMarker:?

nnhubbard commented 5 years ago

I spent too much time trying to debug this issue and couldn't figure it out and needed to move on. I moved to Google Maps Utilities clustering instead.

peterlendvay commented 5 years ago

@maxep We are experiencing the same issue, but we are actually changing the cluster list in mapView:didTapMarker:. Is there a solution for this? Thanks!