Skip to content

Commit b3c8f2a

Browse files
committed
execute on_stop callback of all timers on bot shutdown
1 parent c6bcab5 commit b3c8f2a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/dpp/cluster.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,13 @@ void cluster::shutdown() {
445445

446446
{
447447
std::lock_guard<std::mutex> l(timer_guard);
448+
while (!this->next_timer.empty()) {
449+
timer_t cur_timer = std::move(next_timer.top());
450+
if (cur_timer.on_stop) {
451+
cur_timer.on_stop(cur_timer.handle);
452+
}
453+
next_timer.pop();
454+
}
448455
next_timer = {};
449456
}
450457

0 commit comments

Comments
 (0)