MapView's onDestroy method is not working properly

I found that my app is piling up native memory usage if I initiate app, then put to background, then initiate app, then put to background etc.

Then I debugged and found that my NativeMapViewImpl object is not recycled.
(I have 6 NativeMapViewImpl objects in 6 operations.)
And it looks like my call to MapView’s onDestory method did not work properly.
Are there any conditions to make the MapView’s onDestory method working properly?
I used the dynamic loading framework, so I passed Context to TomTom instead of Activity when I constructed a new MapView.
When destroying the object, I simply called onDestroy.
I suspect it’s due to Context does not have the same state as Activity

Can anyone help me on this?

Hi James,

The Android Team managed to reproduce this issue and it seems that it’s on the SDK side. We’ll fix it soon in the next releases.

1 Like