Shared/Metric: Fix a rare memory leak

Fix a memory leak in Metric happening only when enabling/disabling Metric from configs at runtime, leaking the metric added between last SendBatch() call and the ScheduleSend() call in the same function. The only way to reproduce this is to actually freeze the thread calling SendBatch(), disable metric, reload config, unfreeze the thread.
This commit is contained in:
jackpoz
2019-04-27 17:18:13 +02:00
committed by Ovahlord
parent a730e17a37
commit 66f2bd91bb

View File

@@ -209,7 +209,7 @@ void Metric::ScheduleSend()
MetricData* data;
// Clear the queue
while (_queuedData.Dequeue(data))
;
delete data;
}
}