# HG changeset patch # User Xeli # Date 1316190290 -7200 # Node ID 9f05a0f4300333c6d7602b0535e1ceac372327f7 # Parent 5164d17b6374ffd81d8dcb2ab1b6777bd8232080 Exit hedgewars cleanly and return to the frontend with out crashing + fixed error messages "foo" -> HWEngine_Loader diff -r 5164d17b6374 -r 9f05a0f43003 project_files/Android-build/SDL-android-project/jni/SDL/src/main/android/SDL_android_main.cpp --- a/project_files/Android-build/SDL-android-project/jni/SDL/src/main/android/SDL_android_main.cpp Fri Sep 16 18:17:16 2011 +0200 +++ b/project_files/Android-build/SDL-android-project/jni/SDL/src/main/android/SDL_android_main.cpp Fri Sep 16 18:24:50 2011 +0200 @@ -43,7 +43,7 @@ } /* We exit here for consistency with other platforms. */ - exit(status); + //exit(status); Xeli: Or lets not crash the entire app..... } /* vi: set ts=4 sw=4 expandtab: */ diff -r 5164d17b6374 -r 9f05a0f43003 project_files/Android-build/SDL-android-project/jni/src/hedgewars_main.c --- a/project_files/Android-build/SDL-android-project/jni/src/hedgewars_main.c Fri Sep 16 18:17:16 2011 +0200 +++ b/project_files/Android-build/SDL-android-project/jni/src/hedgewars_main.c Fri Sep 16 18:24:50 2011 +0200 @@ -17,8 +17,8 @@ __android_log_print(ANDROID_LOG_INFO, TAG, "HWEngine being loaded"); handle = dlopen("libhwengine.so", RTLD_NOW|RTLD_GLOBAL); if(!handle){ - __android_log_print(ANDROID_LOG_INFO, "foo", dlerror()); - __android_log_print(ANDROID_LOG_INFO, "foo", "error dlopen"); + __android_log_print(ANDROID_LOG_INFO, TAG, dlerror()); + __android_log_print(ANDROID_LOG_INFO, TAG, "error dlopen"); exit(EXIT_FAILURE); } dlerror(); @@ -28,13 +28,13 @@ Game = (HWEngine_Game) dlsym(handle,"Game"); if((error = dlerror()) != NULL){ - __android_log_print(ANDROID_LOG_INFO, "foo", error); - __android_log_print(ANDROID_LOG_INFO, "foo", "error dlsym"); + __android_log_print(ANDROID_LOG_INFO, TAG, error); + __android_log_print(ANDROID_LOG_INFO, TAG, "error dlsym"); exit(EXIT_FAILURE); } - __android_log_print(ANDROID_LOG_INFO, "foo", "dlsym succeeded"); + __android_log_print(ANDROID_LOG_INFO, TAG, "dlsym succeeded"); Game(argv); - __android_log_print(ANDROID_LOG_INFO, "foo", "Game() succeeded"); + __android_log_print(ANDROID_LOG_INFO, TAG, "Game() ended"); dlclose(handle); } diff -r 5164d17b6374 -r 9f05a0f43003 project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/SDLActivity.java --- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/SDLActivity.java Fri Sep 16 18:17:16 2011 +0200 +++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/SDLActivity.java Fri Sep 16 18:24:50 2011 +0200 @@ -285,7 +285,8 @@ String.valueOf(surfaceWidth), String.valueOf(surfaceHeight), "0", "null", "xeli", "1", "1", "1", "0", "", path }); - // Log.v("SDL", "SDL thread terminated"); + //Log.v("SDL", "SDL thread terminated"); + SDLActivity.mSingleton.finish(); } } @@ -514,7 +515,7 @@ Log.v("SDL", "key down: " + keyCode); if(keyCode == KeyEvent.KEYCODE_BACK){//TODO ask user to quit or not SDLActivity.nativeQuit(); - SDLActivity.mSingleton.finish(); + //SDLActivity.mSingleton.finish(); }else{ SDLActivity.onNativeKeyDown(keyCode); }