|
@@ -247,10 +247,19 @@ public class OGLESContext implements JmeContext, GLSurfaceView.Renderer, SoftTex
|
|
}
|
|
}
|
|
|
|
|
|
listener.destroy();
|
|
listener.destroy();
|
|
-
|
|
|
|
|
|
+ // releases the view holder from the Android Input Resources
|
|
|
|
+ // releasing the view enables the context instance to be
|
|
|
|
+ // reclaimed by the GC.
|
|
|
|
+ // if not released; it leads to a weak reference leak
|
|
|
|
+ // disabling the destruction of the Context View Holder.
|
|
|
|
+ androidInput.setView(null);
|
|
|
|
+
|
|
|
|
+ // nullifying the references
|
|
|
|
+ // signals their memory to be reclaimed
|
|
listener = null;
|
|
listener = null;
|
|
renderer = null;
|
|
renderer = null;
|
|
timer = null;
|
|
timer = null;
|
|
|
|
+ androidInput = null;
|
|
|
|
|
|
// do android specific cleaning here
|
|
// do android specific cleaning here
|
|
logger.fine("Display destroyed.");
|
|
logger.fine("Display destroyed.");
|