Project: titanium
Issue TIMOB-7467: iOS: Map Annotation Memory Leak
h4. PROBLEM DESCRIPTION User added and removed annotations from the map, it was releasing the TiMapAnnotationProxy but not the TiMapPinAnnotationView. It kept them "Living" and continued to add to their live bytes instead of moving the old ones into "Transitory". h4. ACTUAL BEHAVIOR TiMapPinAnnotationView is not being released. h4. EXPECTED BEHAVIOR TiMapPinAnnotationView should be released when not needed. h4. TEST CASE {code} var win = Ti.UI.createWindow({ title:'Map' }), map = Ti.Map.createView({ region:{ latitude:36, latitudeDelta:5, longitude:-93, longitudeDelta:5 }, toggled:false, userLocation:false }), toggleAnnos = function(e){ var lat = 31, lng = (e.source.toggled ? -98 : -89), annos = []; for(i=0;i<10;i++){ annos.push({latitude:lat,longitude:lng}); lat++; if(e.source.toggled){ lng++; }else{ lng--; } } e.source.removeAllAnnotations(); e.source.addAnnotations(annos); e.source.toggled = !e.source.toggled; }; win.add(map); win.open(); map.addEventListener('regionChanged',toggleAnnos); {code} h4. COMMUNITY DISCUSSION http://developer.appcelerator.com/question/131291/map-annotation-memory-leak
Story points: 8