diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java index 24f10fb6b6..629dabb168 100644 --- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java +++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java @@ -658,7 +658,11 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh // Wait for "SDLThread" thread to end try { - SDLActivity.mSDLThread.join(); + // 500ms timeout, because: + // C SDLmain() thread might have started (mSDLThread.start() called) + // while the SDL_Init() might not have been called yet, + // and so the previous QUIT event will be discarded by SDL_Init() and app is running, not exiting. + SDLActivity.mSDLThread.join(500); } catch(Exception e) { Log.v(TAG, "Problem stopping SDLThread: " + e); }