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 58a10ad commit b3c9142
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 @@ -148,6 +148,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 b3c9142

Please sign in to comment.