Get rid of the pesky _exit call

This commit is contained in:
Mm2PL 2023-12-01 14:46:37 +01:00
parent 6d02bb7304
commit 865dd130da
No known key found for this signature in database
GPG key ID: 94AC9B80EFA15ED9

View file

@ -20,6 +20,7 @@
#include <QtConcurrent>
#include <csignal>
#include <thread>
#include <tuple>
#ifdef USEWINSDK
@ -244,7 +245,8 @@ void runGui(QApplication &a, Paths &paths, Settings &settings)
restartOnSignal = value;
});
auto thread = std::thread([dir = paths.miscDirectory] {
auto thread = std::jthread([dir = paths.miscDirectory] {
#ifdef Q_OS_WIN32
{
auto path = combinePath(dir, "Update.exe");
if (QFile::exists(path))
@ -259,6 +261,7 @@ void runGui(QApplication &a, Paths &paths, Settings &settings)
QFile::remove(path);
}
}
#endif
});
// Clear the cache 1 minute after start.
@ -314,7 +317,5 @@ void runGui(QApplication &a, Paths &paths, Settings &settings)
// flushing windows clipboard to keep copied messages
flushClipboard();
#endif
_exit(0);
}
} // namespace chatterino