瀏覽代碼

HPCC-13986 Valgrind reporting memory leaks from Roxie re statistics

The query accumulators for active queries were not released at the end of the
program. This is not a real memory leak, but addressing it makes it easier to
spot others.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 10 年之前
父節點
當前提交
e863cfb4ea
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      roxie/ccd/ccdsnmp.cpp

+ 7 - 1
roxie/ccd/ccdsnmp.cpp

@@ -912,7 +912,13 @@ public:
         expirySeconds = _expirySeconds;
         expirySeconds = _expirySeconds;
         queryStatsAggregators.append(*LINK(this));
         queryStatsAggregators.append(*LINK(this));
     }
     }
-
+    ~CQueryStatsAggregator()
+    {
+        while (recent.ordinality())
+        {
+            recent.dequeue()->Release();
+        }
+    }
     static IPropertyTree *getAllQueryStats(bool includeQueries, time_t from, time_t to)
     static IPropertyTree *getAllQueryStats(bool includeQueries, time_t from, time_t to)
     {
     {
         Owned<IPTree> result = createPTree("QueryStats");
         Owned<IPTree> result = createPTree("QueryStats");