Skip to content

Commit

Permalink
Get rid of the pesky _exit call
Browse files Browse the repository at this point in the history
  • Loading branch information
Mm2PL committed Dec 1, 2023
1 parent 6d02bb7 commit 865dd13
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/RunGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <QtConcurrent>

#include <csignal>
#include <thread>
#include <tuple>

#ifdef USEWINSDK
Expand Down Expand Up @@ -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))
Expand All @@ -259,6 +261,7 @@ void runGui(QApplication &a, Paths &paths, Settings &settings)
QFile::remove(path);
}
}
#endif
});

// Clear the cache 1 minute after start.
Expand Down Expand Up @@ -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

0 comments on commit 865dd13

Please sign in to comment.