deptofdefense / AndroidTacticalAssaultKit-CIV

Other
900 stars 321 forks source link

Default Map group overlay leaches icon bitmap #282

Open L-Belluomini opened 1 year ago

L-Belluomini commented 1 year ago

in the development of a plugin, I have discovered that setting the element icon using the iconuri metastring, while rendering the overlay manager model list leaks the icon bitmap up to te point o stalling te app. the icon is a png in the plugin res.

bisgroves commented 1 year ago

Can you provide addition information and the observed lines of code?

L-Belluomini commented 1 year ago

hi, so the case where I found this is a plugin I am working on, specifically in this class https://github.com/L-Belluomini/OTN/blob/main/app/src/main/java/com/atakmap/android/OTN/OTNMapComponent.java line 217 onwards.

I copy the main part here:

mapGroup = new DefaultMapGroup("OTNoverlay"); overlay = new DefaultMapGroupOverlay ( MapView.getMapView() , mapGroup ); mapGroup.setMetaString("iconUri" , "android.resource://"+ pluginContext.getPackageName() + "/" + R.drawable.otn_logo); view.getMapOverlayManager().addOverlay( overlay );

so here if the metaString, iconUri is set to a png. when I open the relative overlay, from the debbuger I see lots png filling up memory and atak basically halts.