juangaav / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

MyLocationNewOverlay memory leak on using enableMyLocation #545

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, i have a memory leak on my application using OSMDroid 4.2. Using DDMS i 
found out it was due to a call to "enableMyLocation".
Here are my steps to detect the problem.

What steps will reproduce the problem?
1. Create an activity with an instance of MyLocationNewOverlay calling 
enableMyLocation (in onCreate)

2. Create two other activities (1 before, 1 after) in order to have a story 
board

3. Moving from 1->2->3 3->2-1, catching memory usage using DDMS, moving again 
1->2->3 3->2->1, Boom, memory has increased.

4. Disable "enableMyLocation" and repeating step3, memory hasn't increased this 
time.

What version of the product are you using? On what operating system?

OSMDroid 4.2 Android 4.1.2 on a Galaxy Note 10.1

Original issue reported on code.google.com by mahe.c...@gmail.com on 29 Aug 2014 at 1:23

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Ok i found out how to use it properly by looking at the methods. Calling 
"disableMyLocation()" in onPause of the activity solves the problem.

Original comment by mahe.c...@gmail.com on 29 Aug 2014 at 1:58

GoogleCodeExporter commented 9 years ago

Original comment by neilboyd on 30 Aug 2014 at 7:57