From c4fad09b3d29679b15d456f6cc0d61b0f59a8d4c Mon Sep 17 00:00:00 2001 From: cpasjuste Date: Fri, 24 Apr 2020 13:36:18 +0200 Subject: switch: don't use atexit not working on switch --- src/maingui.cpp | 4 ++++ src/progs/manaplus/client.cpp | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/maingui.cpp b/src/maingui.cpp index f10c0efe7..8b0ddd218 100644 --- a/src/maingui.cpp +++ b/src/maingui.cpp @@ -191,6 +191,10 @@ int mainGui(int argc, char *argv[]) IMG_Quit(); #endif // SDL_IMAGE_VERSION_ATLEAST(1, 2, 11) +#ifdef __SWITCH__ + SDL_Quit(); +#endif + #ifdef __SWITCH__ NxDeinit(); #endif diff --git a/src/progs/manaplus/client.cpp b/src/progs/manaplus/client.cpp index 772975214..cea2d10af 100644 --- a/src/progs/manaplus/client.cpp +++ b/src/progs/manaplus/client.cpp @@ -387,8 +387,9 @@ void Client::gameInit() logger->safeError(strprintf("Could not initialize SDL: %s", SDL_GetError())); } +#ifndef __SWITCH__ atexit(SDL_Quit); - +#endif PacketLimiter::initPacketLimiter(); #ifndef USE_SDL2 SDL_EnableUNICODE(1); -- cgit v1.2.3-60-g2f50