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.

(cherry picked from commit 0d1ff7446d)
This commit is contained in:
jackpoz
2019-04-27 17:18:13 +02:00
committed by Shauren
parent 98863659bb
commit dc2fed13c8

View File

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