Browse Source

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 years ago
parent
commit
e863cfb4ea
1 changed files with 7 additions and 1 deletions
  1. 7 1
      roxie/ccd/ccdsnmp.cpp

+ 7 - 1
roxie/ccd/ccdsnmp.cpp

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