소스 검색

Don't crash on exit from SDLActivity if we don't have a singleton for some reason. (Thanks Rachel!)

Sam Lantinga 7 년 전
부모
커밋
63317dfb17
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      android-project/app/src/main/java/org/libsdl/app/SDLActivity.java

+ 4 - 1
android-project/app/src/main/java/org/libsdl/app/SDLActivity.java

@@ -427,7 +427,10 @@ public class SDLActivity extends Activity {
     /* The native thread has finished */
     /* The native thread has finished */
     public static void handleNativeExit() {
     public static void handleNativeExit() {
         SDLActivity.mSDLThread = null;
         SDLActivity.mSDLThread = null;
-        mSingleton.finish();
+
+        // Make sure we currently have a singleton before we try to call it.
+        if (mSingleton != null)
+            mSingleton.finish();
     }
     }