mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-15 15:58:13 +00:00
Fixed bug 3728 - [Android] crash when shared libraries are no loaded
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.
This commit is contained in:
@@ -265,9 +265,6 @@ public class SDLActivity extends Activity {
|
|||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
Log.v(TAG, "onDestroy()");
|
Log.v(TAG, "onDestroy()");
|
||||||
|
|
||||||
mNextNativeState = NativeState.PAUSED;
|
|
||||||
SDLActivity.handleNativeState();
|
|
||||||
|
|
||||||
if (SDLActivity.mBrokenLibraries) {
|
if (SDLActivity.mBrokenLibraries) {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
// Reset everything in case the user re opens the app
|
// Reset everything in case the user re opens the app
|
||||||
@@ -275,6 +272,9 @@ public class SDLActivity extends Activity {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mNextNativeState = NativeState.PAUSED;
|
||||||
|
SDLActivity.handleNativeState();
|
||||||
|
|
||||||
// Send a quit message to the application
|
// Send a quit message to the application
|
||||||
SDLActivity.mExitCalledFromJava = true;
|
SDLActivity.mExitCalledFromJava = true;
|
||||||
SDLActivity.nativeQuit();
|
SDLActivity.nativeQuit();
|
||||||
|
Reference in New Issue
Block a user