hulab / ClusterKit

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

mapView(_:didTap:) crashes randomly #90

Open Rakesh-iOS opened 3 years ago

Rakesh-iOS commented 3 years ago

Hi I am getting this crash randomly on Production live app.

Here is the code snippet: func mapView(_ mapView: GMSMapView, didTap marker: GMSMarker) -> Bool {

    if marker.responds(to: #selector(getter: GMSMarker.cluster)) {
               if let cluster = marker.cluster, cluster.count > 1 { **// crash strack trace indicating this line where crash happen**
                   OperationQueue.main.addOperation {
                       let cameraUpdate = GMSCameraUpdate.fit(marker.cluster!)
                       mapView.animate(with: cameraUpdate)
                   }
                   return true
               }
    }

}

ClusterKit version: 0.5.0 GoogleMapExtension: "GMSMapView+ClusterKit.h"

Screenshot 2020-10-13 at 11 04 52 AM

This is Firebase crash report :

Screenshot 2020-10-13 at 10 23 41 AM

Please help me out. It would be highly appreciated as I'm getting this crash from last 4 - 5 releases.

alexvaiman commented 3 years ago

when you remove marks from map - remove them from the map as well (not only from cluster manager) the cluster manager is not synced with what you see on the map other wise.