jPCT-AE - a 3d engine for Android => Support => Topic started by: smither on September 20, 2010, 09:28:07 pm

Title: OutOfMemoryError Exception
Post by: smither on September 20, 2010, 09:28:07 pm
Giving the fact the Engine destroy the glContext when the activity goes to the background I try to reload everything again for the next time but I get an OutOfMemoryError Exception.

Anyone else had run on this issue?
Title: Re: OutOfMemoryError Exception
Post by: EgonOlsen on September 20, 2010, 10:40:08 pm
If you want to reload everything, make sure that no references to the former instances are left. destroy, flush, close and null everything before reloading. Apart from that, you don't have to reload. All you need is a new FrameBuffer instance, make the Textures keep their pixel data (there is a method for this) and some copy-magic. There is a thread here somewhere in the AE forum that mentions what i did in AlienRunner. It might be the AlienRunner thread itself, but i'm mot sure..