diff options
author | Sven Gothel <[email protected]> | 2013-03-23 11:17:31 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-03-23 11:17:31 +0100 |
commit | 218b9d88f4ec1d15a46697dd7c5e835660020f99 (patch) | |
tree | 4d1591e517c0853bf4c4806c17481eb3f64bf1a2 | |
parent | d514ecbf052d013ea8c0982c490757678075a9ea (diff) |
NEWT/Android: Fix suspense regression of commit d514ecbf052d013ea8c0982c490757678075a9ea
Explicit win.destroy() shall only be called at activity.onDestroy(),
- GLStateKeeper preservation is marked at pause,
- and the Window's surfaceDestroyed() will also issue destroy() - so it's safe
Reason: On Suspense (or power button), application is paused _without_ surfaceDestruction !
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java b/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java index 2ea7a9d84..ab8fc8ad0 100644 --- a/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java +++ b/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java @@ -200,6 +200,7 @@ public class NewtBaseActivity extends Activity { @Override public void glStateRestored(GLStateKeeper glsk) { Log.d(MD.TAG, "GLStateKeeper Restored: 0x"+Integer.toHexString(glsk.hashCode())); + startAnimation(true); } }; @@ -380,12 +381,11 @@ public class NewtBaseActivity extends Activity { } } } - Log.d(MD.TAG, "GLStateKeeper.Preserving: Total "+glAutoDrawables.size()+", OK "+ok+", Fail "+fail); + Log.d(MD.TAG, "GLStateKeeper.Mark2Preserve: Total "+glAutoDrawables.size()+", OK "+ok+", Fail "+fail); } for(int i=0; i<newtWindows.size(); i++) { final Window win = newtWindows.get(i); win.setVisible(false); - win.destroy(); } startAnimation(false); if( !isDelegatedActivity() ) { @@ -404,6 +404,10 @@ public class NewtBaseActivity extends Activity { @Override public void onDestroy() { Log.d(MD.TAG, "onDestroy"); + for(int i=0; i<newtWindows.size(); i++) { + final Window win = newtWindows.get(i); + win.destroy(); + } newtWindows.clear(); glAutoDrawables.clear(); jogamp.common.os.android.StaticContext.clear(); |