Skip to content

Commit 6735cb7

Browse files
committed
OGLESContext#deinitInThread(): releasing the weak references of the Application#context
1 parent 5e70e87 commit 6735cb7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

jme3-android/src/main/java/com/jme3/system/android/OGLESContext.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,19 @@ protected void deinitInThread() {
247247
}
248248

249249
listener.destroy();
250-
250+
// releases the view holder from the Android Input Resources
251+
// releasing the view enables the context instance to be
252+
// reclaimed by the GC.
253+
// if not released; it leads to a weak reference leak
254+
// disabling the destruction of the Context View Holder.
255+
androidInput.setView(null);
256+
257+
// nullifying the references
258+
// signals their memory to be reclaimed
251259
listener = null;
252260
renderer = null;
253261
timer = null;
262+
androidInput = null;
254263

255264
// do android specific cleaning here
256265
logger.fine("Display destroyed.");

0 commit comments

Comments
 (0)