efremidze / Cluster

Easy Map Annotation Clustering 📍
MIT License
1.28k stars 121 forks source link

Crash in QuadTreeNode annotations(in rect: MKMapRect) #92

Closed kylemay-gridstone closed 5 years ago

kylemay-gridstone commented 6 years ago

New Issue Checklist

Issue Description

I have noticed a few times that there has been a crash in QuadTree.swift:132 The line is for annotation in annotations where rect.contains(annotation.coordinate) and the crash is due to index out of bounds. Presumably this is due to iterating the annotations array while it is being modified. Perhaps a copy of this array should be made inside the method to be used for the iteration. I'm not sure if this fixes it.

I cannot replicate this, however it has happened on multiple versions including the latest, 2.2.9. When this happened today the map was in memory but not visible on screen (page view controller sho8wing another page).

Environment

efremidze commented 6 years ago

Thanks for reporting. Currently fixing this issue.

efremidze commented 6 years ago

Released 2.3.0. Let me know if you still see the crash.

yurii-petrov commented 6 years ago

@efremidze I have the same problem, I updated Cluster to the latest version (Cluster (2.4.0)). https://drive.google.com/open?id=1JVSrB7vGc71UO7Jm93_5weLcaevItpnb

efremidze commented 6 years ago

I recently noticed it's still occurring. I'll fix it asap.

antoine20001 commented 5 years ago

Same issue on Cluster (2.4.0), iPhone XR iOS 12.1

yurii-petrov commented 5 years ago

Hello. @efremidze. Do you have some news about this problem?

efremidze commented 5 years ago

@petrovRV @antoine20001 Sorry for the delay. I've improved thread safety in 2.4.1. Try it out.