Skip to content

Commit

Permalink
l_LegacyDowntimesCache: delete removed objects not to leak memory
Browse files Browse the repository at this point in the history
  • Loading branch information
Al2Klimov committed Sep 17, 2024
1 parent d09d051 commit 7761d6f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/icinga/downtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ void Downtime::Start(bool runtimeCreated)

void Downtime::Stop(bool runtimeRemoved)
{
{
std::unique_lock<std::mutex> lock (l_DowntimeMutex);

l_LegacyDowntimesCache.erase(GetLegacyId());
}

GetCheckable()->UnregisterDowntime(this);

Downtime::Ptr parent = GetByName(GetParent());
Expand Down

0 comments on commit 7761d6f

Please sign in to comment.