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:
1 parent
a730e17a37
commit
66f2bd91bb
1 file changed
+1
-1
@@ -209,7 +209,7 @@ void Metric::ScheduleSend()
|
||||
MetricData* data;
|
||||
// Clear the queue
|
||||
while (_queuedData.Dequeue(data))
|
||||
;
|
||||
delete data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user