diff --git a/lib/icinga/downtime.cpp b/lib/icinga/downtime.cpp index 0452a3c7d..c0f7d6e5e 100644 --- a/lib/icinga/downtime.cpp +++ b/lib/icinga/downtime.cpp @@ -15,7 +15,7 @@ using namespace icinga; static int l_NextDowntimeID = 1; static std::mutex l_DowntimeMutex; -static std::map l_LegacyDowntimesCache; +static std::map l_LegacyDowntimesCache; static Timer::Ptr l_DowntimesExpireTimer; static Timer::Ptr l_DowntimesStartTimer; @@ -108,7 +108,7 @@ void Downtime::Start(bool runtimeCreated) std::unique_lock lock(l_DowntimeMutex); SetLegacyId(l_NextDowntimeID); - l_LegacyDowntimesCache[l_NextDowntimeID] = GetName(); + l_LegacyDowntimesCache[l_NextDowntimeID] = this; l_NextDowntimeID++; } @@ -479,7 +479,7 @@ String Downtime::GetDowntimeIDFromLegacyID(int id) if (it == l_LegacyDowntimesCache.end()) return Empty; - return it->second; + return it->second->GetName(); } void Downtime::DowntimesStartTimerHandler()