Skip to content

Commit

Permalink
destroy thread for socket loop before trying to destroy anything that…
Browse files Browse the repository at this point in the history
… may be within it
  • Loading branch information
braindigitalis committed Nov 19, 2024
1 parent 276e2ff commit 317717e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dpp/cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::mutex> l(timer_guard);
/* Free memory for active timers */
Expand All @@ -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) {
Expand Down

0 comments on commit 317717e

Please sign in to comment.