ribl / FBAnnotationClusteringSwift

Swift translation of FB Annotation Clustering, which clusters pins on the map for iOS.
http://ribl.co/blog/2015/05/28/map-clustering-with-swift-how-we-implemented-it-into-the-ribl-ios-app/
MIT License
311 stars 109 forks source link

ViewController with Mapview ClusteringManager stucks in memory after ViewController is left #10

Open iamZoltanVaradi opened 8 years ago

iamZoltanVaradi commented 8 years ago

Because of the ClusteringManager's delegate, the ViewController that contains the map with the clustering view cannot get freed from the the memory. Easy solution: set the delegate to nil once You no longer want to use the clusteringManager. I'd recommend to have this added to the usage steps.

chenr2 commented 8 years ago

Thanks for pointing this out, @iamZoltanVaradi. Would you like to submit a pull request with the approach you used, applied to FBViewController, and maybe add what you just said to a "Things to watch out for" section in the readme?

iamZoltanVaradi commented 8 years ago

I'll add the solution to the readme soon. Thank You!

antranthien commented 8 years ago

Is it ok if I set the delegate to nil in deinit?