From: Alexander A. Klimov Date: Wed, 17 Jul 2019 11:35:59 +0000 (+0200) Subject: Shutdown timers cleanly on exit X-Git-Tag: v2.11.0-rc1~22^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=80d976fed64077b5cdcd86f47b85adcff5987fe8;p=icinga2 Shutdown timers cleanly on exit refs #7327 --- diff --git a/lib/base/timer.cpp b/lib/base/timer.cpp index 07a4f30de..6abac8566 100644 --- a/lib/base/timer.cpp +++ b/lib/base/timer.cpp @@ -1,5 +1,6 @@ /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */ +#include "base/defer.hpp" #include "base/timer.hpp" #include "base/debug.hpp" #include "base/logger.hpp" @@ -57,6 +58,8 @@ static bool l_StopTimerThread; static TimerSet l_Timers; static int l_AliveTimers = 0; +static Defer l_ShutdownTimersCleanlyOnExit (&Timer::Uninitialize); + /** * Destructor for the Timer class. */