1
0
Fork 0

Fixed a possible throw in destructor.

This commit is contained in:
Michael Hackstein 2017-02-13 10:40:42 +01:00
parent 5c7b971122
commit 3add00025a
1 changed files with 7 additions and 17 deletions

View File

@ -117,24 +117,14 @@ BaseTraverserEngine::BaseTraverserEngine(TRI_vocbase_t* vocbase,
}
BaseTraverserEngine::~BaseTraverserEngine() {
/*
auto resolver = _trx->resolver();
// TODO Do we need this or will delete trx do this already?
for (auto const& shard : _locked) {
TRI_voc_cid_t cid = resolver->getCollectionIdLocal(shard);
if (cid == 0) {
LOG_TOPIC(ERR, arangodb::Logger::FIXME) << "Failed to unlock shard " << shard << ": not found";
continue;
}
int res = _trx->unlock(_trx->trxCollection(cid), AccessMode::Type::READ);
if (res != TRI_ERROR_NO_ERROR) {
LOG_TOPIC(ERR, arangodb::Logger::FIXME) << "Failed to unlock shard " << shard << ": "
<< TRI_errno_string(res);
}
}
*/
if (_trx) {
_trx->commit();
try {
_trx->commit();
} catch (...) {
// If we could not commit
// we are in a bad state.
// This is a READ-ONLY trx
}
}
delete _query;
}