From f03208890256acd6d3e6b072a125465db4364de6 Mon Sep 17 00:00:00 2001 From: Timothy Redaelli Date: Thu, 8 Sep 2022 17:05:31 +0200 Subject: [PATCH] Use _Exit instead of exit under Linux (#204) The best ExitProcess alternative for Linux is _Exit since it doesn't call exit handlers. --- src/Common/ExceptionHandler/ExceptionHandler_posix.cpp | 2 +- src/gui/CemuApp.cpp | 2 +- src/gui/MainWindow.cpp | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Common/ExceptionHandler/ExceptionHandler_posix.cpp b/src/Common/ExceptionHandler/ExceptionHandler_posix.cpp index 2f18c2d7..b9ecb782 100644 --- a/src/Common/ExceptionHandler/ExceptionHandler_posix.cpp +++ b/src/Common/ExceptionHandler/ExceptionHandler_posix.cpp @@ -26,7 +26,7 @@ void handler_SIGINT(int sig) * by any mean ends up with a SIGABRT from the standard library destroying * threads. */ - exit(0); + _Exit(0); } void ExceptionHandler_init() diff --git a/src/gui/CemuApp.cpp b/src/gui/CemuApp.cpp index e78b30b3..8563ae2c 100644 --- a/src/gui/CemuApp.cpp +++ b/src/gui/CemuApp.cpp @@ -142,7 +142,7 @@ int CemuApp::OnExit() #if BOOST_OS_WINDOWS ExitProcess(0); #else - exit(0); + _Exit(0); #endif } diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index ec821ce5..53363ae3 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -47,6 +47,8 @@ #if BOOST_OS_WINDOWS #define exit(__c) ExitProcess(__c) +#else +#define exit(__c) _Exit(__c) #endif #if BOOST_OS_LINUX || BOOST_OS_MACOS