1
0
Fork 0

Handle exception correctly in AqlValue.

This commit is contained in:
Max Neunhoeffer 2014-09-08 14:42:21 +02:00
parent b011876512
commit 0eed7a8344
1 changed files with 11 additions and 2 deletions

View File

@ -116,8 +116,17 @@ AqlValue AqlValue::clone () const {
case DOCVEC: {
auto c = new std::vector<AqlItemBlock*>;
c->reserve(_vector->size());
for (auto it = _vector->begin(); it != _vector->end(); ++it) {
c->push_back((*it)->slice(0, (*it)->size()));
try {
for (auto it = _vector->begin(); it != _vector->end(); ++it) {
c->push_back((*it)->slice(0, (*it)->size()));
}
}
catch (...) {
for (auto x : *c) {
delete x;
}
delete c;
throw;
}
return AqlValue(c);
}