AndroidTacticalAssaultKit-CIV icon indicating copy to clipboard operation
AndroidTacticalAssaultKit-CIV copied to clipboard

Default Map group overlay leaches icon bitmap

Open L-Belluomini opened this issue 2 years ago • 2 comments

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.

L-Belluomini avatar Mar 19 '23 17:03 L-Belluomini

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

bisgroves avatar Jun 22 '23 13:06 bisgroves

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.

L-Belluomini avatar Jun 26 '23 18:06 L-Belluomini