From 144ee7a8f031b24460f30b4bb65a7d0a1803a8fb Mon Sep 17 00:00:00 2001 From: James Date: Sat, 27 Sep 2014 13:10:14 +0100 Subject: [PATCH] destructor for IndexRangeBlock, deletes private data --- arangod/Aql/ExecutionBlock.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/arangod/Aql/ExecutionBlock.cpp b/arangod/Aql/ExecutionBlock.cpp index 1bfe56b6ed..0f03a5c351 100644 --- a/arangod/Aql/ExecutionBlock.cpp +++ b/arangod/Aql/ExecutionBlock.cpp @@ -878,10 +878,34 @@ IndexRangeBlock::IndexRangeBlock (ExecutionEngine* engine, } IndexRangeBlock::~IndexRangeBlock () { + + if (_collection != nullptr) { + delete _collection; + _collection = nullptr; + } + + // FIXME is it necessary to do anything to the TRI_doc_mptr_copy_t's in + // _documents ??? + _documents.clear(); + for (auto e : _allVariableBoundExpressions) { delete e; } _allVariableBoundExpressions.clear(); + + for (auto x : _inVars) { + for (auto y : x) { + delete y; + } + x.clear(); + } + _inVars.clear(); + + for (auto x : _inRegs) { + x.clear(); + } + _inRegs.clear(); + } int IndexRangeBlock::initialize () {