From 317717ee380e74679776fcb306e3296c40bc2f00 Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Tue, 19 Nov 2024 22:50:07 +0000 Subject: [PATCH] destroy thread for socket loop before trying to destroy anything that may be within it --- src/dpp/cluster.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dpp/cluster.cpp b/src/dpp/cluster.cpp index a1024fb28c..c09616b9b1 100644 --- a/src/dpp/cluster.cpp +++ b/src/dpp/cluster.cpp @@ -310,6 +310,9 @@ void cluster::start(bool return_after) { void cluster::shutdown() { /* Signal termination */ terminating = true; + if (engine_thread) { + engine_thread->join(); + } { std::lock_guard l(timer_guard); /* Free memory for active timers */ @@ -324,9 +327,6 @@ void cluster::shutdown() { delete sh.second; } shards.clear(); - if (engine_thread) { - engine_thread->join(); - } } snowflake cluster::get_dm_channel(snowflake user_id) {