Skip to content
Snippets Groups Projects
Commit 313d26d2 authored by Cedric CAFFY's avatar Cedric CAFFY
Browse files

Corrected the memory leak in OStoreDBTest and SchedulerDatabaseTest

parent 7d68ef3f
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,6 @@ namespace catalogue {
class DummyCatalogue: public Catalogue {
public:
DummyCatalogue() {}
DummyCatalogue(const cta::catalogue::DummyCatalogue*) {}
virtual ~DummyCatalogue() { }
void createActivitiesFairShareWeight(const common::dataStructures::SecurityIdentity& admin, const std::string& diskInstanceName, const std::string& acttivity, double weight, const std::string & comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
......
......@@ -64,7 +64,7 @@ public:
// We do a deep reference to the member as the C++ compiler requires the function to be
// already defined if called implicitly.
const auto &factory = GetParam().dbFactory;
m_catalogue = cta::make_unique<cta::catalogue::DummyCatalogue>(new cta::catalogue::DummyCatalogue);
m_catalogue = cta::make_unique<cta::catalogue::DummyCatalogue>();
// Get the OStore DB from the factory.
auto osdb = std::move(factory.create(m_catalogue));
// Make sure the type of the SchedulerDatabase is correct (it should be an OStoreDBWrapperInterface).
......@@ -75,6 +75,7 @@ public:
virtual void TearDown() {
m_db.reset();
m_catalogue.reset();
}
cta::objectstore::OStoreDBWrapperInterface &getDb() {
......
......@@ -72,12 +72,13 @@ public:
using namespace cta;
const SchedulerDatabaseFactory &factory = GetParam().dbFactory;
m_catalogue = cta::make_unique<cta::catalogue::DummyCatalogue>(new cta::catalogue::DummyCatalogue);
m_catalogue = cta::make_unique<cta::catalogue::DummyCatalogue>();
m_db.reset(factory.create(m_catalogue).release());
}
virtual void TearDown() {
m_db.reset();
m_catalogue.reset();
}
cta::SchedulerDatabase &getDb() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment