Skip to content

Commit

Permalink
Fixed bug 3728 - [Android] crash when shared libraries are no loaded
Browse files Browse the repository at this point in the history
Sylvain

On Android, when shared libraries are not correctly loaded (eg SDLActivity.mBrokenLibraries is true), there is a pop-up with an error message.

After user dismisses the pop-up, application crashes:
- because the native function "nativePause()" may no be loaded (if libSDL2.so is not loaded).
- because mSurface is null.
  • Loading branch information
slouken committed Aug 10, 2017
1 parent af44a59 commit a47bf37
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions android-project/src/org/libsdl/app/SDLActivity.java
Expand Up @@ -265,16 +265,16 @@ public void onLowMemory() {
protected void onDestroy() {
Log.v(TAG, "onDestroy()");

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

if (SDLActivity.mBrokenLibraries) {
super.onDestroy();
// Reset everything in case the user re opens the app
SDLActivity.initialize();
return;
}

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

// Send a quit message to the application
SDLActivity.mExitCalledFromJava = true;
SDLActivity.nativeQuit();
Expand Down

0 comments on commit a47bf37

Please sign in to comment.