diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index e498e8b863..d7d726f514 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -1090,6 +1090,8 @@ UI::EventReturn MainScreen::OnExit(UI::EventParams &e) { #ifdef ANDROID_NDK_PROFILER moncleanup(); #endif + // However, let's make sure the config was saved, since it may not have been. + g_Config.Save(); exit(0); #endif diff --git a/ext/native/base/PCMain.cpp b/ext/native/base/PCMain.cpp index 702985e28b..3009521f29 100644 --- a/ext/native/base/PCMain.cpp +++ b/ext/native/base/PCMain.cpp @@ -879,15 +879,15 @@ int main(int argc, char *argv[]) { #ifndef _WIN32 delete joystick; #endif + NativeShutdownGraphics(); + NativeShutdown(); // Faster exit, thanks to the OS. Remove this if you want to debug shutdown // The speed difference is only really noticable on Linux. On Windows you do notice it though #ifndef MOBILE_DEVICE exit(0); #endif - NativeShutdownGraphics(); SDL_PauseAudio(1); SDL_CloseAudio(); - NativeShutdown(); #ifdef USING_EGL EGL_Close(); #endif