From 9321545e65f2d1638a4e50f505c837c90daf1dba Mon Sep 17 00:00:00 2001 From: lightbulblighter Date: Sun, 7 Aug 2022 22:21:04 -0700 Subject: [PATCH] stop updater on dll detach --- Tadah.DLL/Discord.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Tadah.DLL/Discord.cpp b/Tadah.DLL/Discord.cpp index 4965f15..0094241 100644 --- a/Tadah.DLL/Discord.cpp +++ b/Tadah.DLL/Discord.cpp @@ -4,6 +4,7 @@ #ifndef SERVER +bool isRunning = false; std::string username; int placeId; @@ -49,7 +50,9 @@ void InitializeDiscord() void UpdatePresence() { - while (true) + isRunning = true; + + while (isRunning) { std::this_thread::sleep_for(std::chrono::milliseconds(60 * 1000)); @@ -93,6 +96,7 @@ void UpdatePresence() void CleanupDiscord() { + isRunning = false; Discord_Shutdown(); }