OsmSharp / ui

The UI components.
http://osmsharp.com/
GNU General Public License v2.0
139 stars 91 forks source link

Proper dispose of MapViewSurface to prevent activity leak #268

Closed ChristopheOosterlynck closed 8 years ago

ChristopheOosterlynck commented 8 years ago

Activity which contains a MapView will be leaked even if properly disposing the MapView. Mono GC doesn't want to clean up the MapViewSurface because of referencing in the gesture detectors.

Activity leak was observed using Android StrictMode. I also tried the tarjan GC but same problem.

Solution seems to be to clear the reference to the gesture detectors in the Dispose of the MapViewSurface.