mirror of https://gitee.com/bigwinds/arangodb
fixed memleak
This commit is contained in:
parent
07637136d9
commit
31c9e04ae6
|
@ -54,6 +54,7 @@ class BlockCollector;
|
|||
|
||||
class AqlItemBlock {
|
||||
friend class AqlItemBlockManager;
|
||||
friend class BlockCollector;
|
||||
|
||||
public:
|
||||
AqlItemBlock() = delete;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue