1
0
Fork 0

fixed memleak

This commit is contained in:
jsteemann 2017-04-22 00:28:45 +02:00
parent 07637136d9
commit 31c9e04ae6
3 changed files with 7 additions and 5 deletions

View File

@ -54,6 +54,7 @@ class BlockCollector;
class AqlItemBlock {
friend class AqlItemBlockManager;
friend class BlockCollector;
public:
AqlItemBlock() = delete;

View File

@ -45,7 +45,7 @@ RegisterId BlockCollector::nrRegs() const {
void BlockCollector::clear() {
for (auto& it : _blocks) {
it->eraseAll();
it->destroy(); // overkill?
_blockManager->returnBlock(it);
}
_blocks.clear();

View File

@ -200,10 +200,11 @@ AqlItemBlock* EnumerateCollectionBlock::getSome(size_t, // atLeast,
res->setValue(send, static_cast<arangodb::aql::RegisterId>(curRegs),
AqlValue(vpack, AqlValueFromManagedDocument()));
} else {
res->setValue(send, static_cast<arangodb::aql::RegisterId>(curRegs),
AqlValue(VPackSlice(vpack)));
AqlValue a(_mmdr->createAqlValue());
AqlValueGuard guard(a, true);
res->setValue(send, static_cast<arangodb::aql::RegisterId>(curRegs), a);
guard.steal();
}
// No harm done, if the setValue throws!
}
if (send > 0) {
@ -223,7 +224,7 @@ AqlItemBlock* EnumerateCollectionBlock::getSome(size_t, // atLeast,
}
throwIfKilled(); // check if we were aborted
TRI_IF_FAILURE("EnumerateCollectionBlock::moreDocuments") {
THROW_ARANGO_EXCEPTION(TRI_ERROR_DEBUG);
}