Skip to content Skip to sidebar Skip to footer

Android Game Leaking Memory Because Of Glthread Reference

Right now I'm developing a game in Android (OpenGL ES 1.1) and I'm seeing that whenever I create a new SurfaceView (GLView) its thread is created. That's ok. The problem comes when

Solution 1:

I had a similar problem with threads (but not using OpenGL), and end up solving it using a simple trick.

Before exting activity (in onPause() or onStop(), try nulling the thread like this:

myThread = null;

It seems that it makes the Thread GC collectable, and therefore you activity becomes also collectable.

It worked for me, as well as for some people with similar problems to whom I gave the same suggestion.

Regards.

Post a Comment for "Android Game Leaking Memory Because Of Glthread Reference"