l_LegacyDowntimesCache: delete removed objects not to leak memory

This commit is contained in:
Alexander A. Klimov 2024-04-25 12:04:37 +02:00
parent c0f87dd4c9
commit 5f80ac17aa
1 changed files with 6 additions and 0 deletions

View File

@ -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());