Navigation Menu

Skip to content

Commit

Permalink
Android: un-needed transition to Pause state.
Browse files Browse the repository at this point in the history
- Don't need to go into Pause state, since onPause() has been called before.
- Don't need to call nativePause is SDLThread is already ended
  • Loading branch information
1bsyl committed Jan 10, 2019
1 parent 8dd9155 commit 61d37de
Showing 1 changed file with 9 additions and 9 deletions.
Expand Up @@ -98,7 +98,7 @@ protected static SDLGenericMotionListener_API12 getMotionListener() {
if (mMotionListener == null) {
if (Build.VERSION.SDK_INT >= 26) {
mMotionListener = new SDLGenericMotionListener_API26();
} else
} else
if (Build.VERSION.SDK_INT >= 24) {
mMotionListener = new SDLGenericMotionListener_API24();
} else {
Expand Down Expand Up @@ -327,15 +327,15 @@ public static int getCurrentOrientation() {
case Surface.ROTATION_0:
result = SDL_ORIENTATION_PORTRAIT;
break;

case Surface.ROTATION_90:
result = SDL_ORIENTATION_LANDSCAPE;
break;

case Surface.ROTATION_180:
result = SDL_ORIENTATION_PORTRAIT_FLIPPED;
break;

case Surface.ROTATION_270:
result = SDL_ORIENTATION_LANDSCAPE_FLIPPED;
break;
Expand Down Expand Up @@ -390,9 +390,6 @@ protected void onDestroy() {
return;
}

mNextNativeState = NativeState.PAUSED;
SDLActivity.handleNativeState();

// Send a quit message to the application
SDLActivity.mExitCalledFromJava = true;
SDLActivity.nativeQuit();
Expand Down Expand Up @@ -483,9 +480,12 @@ public static void handleNativeState() {

// Try a transition to paused state
if (mNextNativeState == NativeState.PAUSED) {
nativePause();
if (mSurface != null)
if (mSDLThread != null) {
nativePause();
}
if (mSurface != null) {
mSurface.handlePause();
}
mCurrentNativeState = mNextNativeState;
return;
}
Expand Down

0 comments on commit 61d37de

Please sign in to comment.