Skip to content

Commit c5e1bfb

Browse files
committed
don't call exit() in onDestroy()
1 parent f252701 commit c5e1bfb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

core/src/processing/core/PApplet.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,6 @@ public void resume() {
765765
public void onDestroy() {
766766
super.onDestroy();
767767
dispose();
768-
exit2();
769768
if (PApplet.DEBUG) {
770769
System.out.println("PApplet.onDestroy() called");
771770
}
@@ -3005,7 +3004,7 @@ protected void handleKeyEvent(KeyEvent event) {
30053004

30063005

30073006
public void onBackPressed() {
3008-
exit();
3007+
exit();
30093008
}
30103009

30113010

@@ -3338,6 +3337,7 @@ void exit2() {
33383337
try {
33393338
if (activity != null) {
33403339
activity.finishAffinity();
3340+
activity = null;
33413341
}
33423342
// System.exit(0);
33433343
} catch (SecurityException e) {
@@ -3368,7 +3368,6 @@ final public void dispose() {
33683368
// https://github.com/processing/processing-android/issues/213#issuecomment-217348480
33693369
surfaceView.getHolder().getSurface().release();
33703370
surfaceView = null;
3371-
// activity = null;
33723371
}
33733372

33743373
handleMethods("dispose");

0 commit comments

Comments
 (0)