diff options
author | jackpoz <giacomopoz@gmail.com> | 2019-04-27 17:18:13 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-12-02 00:39:20 +0100 |
commit | dc2fed13c8a98123ff20316428e41eada36c81e9 (patch) | |
tree | 9cfd59a08d3c1b53500b10de4e089048e52a7ee9 /src/common/Metric/Metric.cpp | |
parent | 98863659bb308f87f2b344e0c7f3b72985d8c5c4 (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.
(cherry picked from commit 0d1ff7446dce7b0641f49ac55a008669838612cd)
Diffstat (limited to 'src/common/Metric/Metric.cpp')
-rw-r--r-- | src/common/Metric/Metric.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/Metric/Metric.cpp b/src/common/Metric/Metric.cpp index f14d3fac531..f4d0661dcaf 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; } } |