1
0
Fork 0

fix leaks

This commit is contained in:
jsteemann 2016-08-30 13:02:04 +02:00
parent d95f1773c4
commit cf42f5dbc8
2 changed files with 9 additions and 3 deletions

View File

@ -122,10 +122,10 @@ arangodb::LogicalCollection* TRI_vocbase_t::registerCollection(
_collectionsById.erase(cid);
throw;
}
collection->setStatus(TRI_VOC_COL_STATUS_UNLOADED);
}
collection->setStatus(TRI_VOC_COL_STATUS_UNLOADED);
return collection.release();
}
@ -630,11 +630,13 @@ void TRI_vocbase_t::shutdown() {
for (auto& collection : _deadCollections) {
delete collection;
}
_deadCollections.clear();
// free collections
for (auto& collection : _collections) {
delete collection;
}
_collections.clear();
}
/// @brief returns names of all known (document) collections
@ -1140,6 +1142,11 @@ TRI_vocbase_t::~TRI_vocbase_t() {
StorageEngine* engine = EngineSelectorFeature::ENGINE;
engine->shutdownDatabase(this);
// do a final cleanup of collections
for (auto& it : _collections) {
delete it;
}
}
std::string TRI_vocbase_t::path() const {

View File

@ -37,7 +37,6 @@
#include "velocypack/Builder.h"
#include "velocypack/velocypack-aliases.h"
struct TRI_collection_t;
class TRI_replication_applier_t;
namespace arangodb {