aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2019-04-27 17:18:13 +0200
committerjackpoz <giacomopoz@gmail.com>2019-04-27 17:18:13 +0200
commit0d1ff7446dce7b0641f49ac55a008669838612cd (patch)
tree7adf1eece0a249427f5edb8524a946014a1a9884 /src
parent844e7ee9262a5ba035ac9e8a6ffc298fb97fd3a9 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/common/Metric/Metric.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/Metric/Metric.cpp b/src/common/Metric/Metric.cpp
index 826bd2b1ae3..94ad282f5ea 100644
--- a/src/common/Metric/Metric.cpp
+++ b/src/common/Metric/Metric.cpp
@@ -209,7 +209,7 @@ void Metric::ScheduleSend()
MetricData* data;
// Clear the queue
while (_queuedData.Dequeue(data))
- ;
+ delete data;
}
}