Commit da4175b4 authored by NICLAUSSE Nicolas's avatar NICLAUSSE Nicolas

delete creators object and add test

parent 5fcf54f3
......@@ -51,6 +51,9 @@ template <typename T> inline void dtkCorePluginFactory<T>::record(const QString&
template <typename T> inline void dtkCorePluginFactory<T>::clear(void)
{
this->creators.clear();
for (QString key: this->creators_plugins.keys()) {
delete this->creators_plugins[key];
}
this->creators_plugins.clear();
}
......
......@@ -74,6 +74,10 @@ void dtkCorePluginFactoryTestCase::testBasic(void)
dtkCorePluginFactoryTestConcept *concept = d->factory.create("dtkCorePluginFactoryTestConceptPlugin");
QVERIFY(concept);
QCOMPARE(QString("dtkCorePluginFactoryTestConceptPlugin"), concept->name());
d->factory.clear();
concept = d->factory.create("dtkCorePluginFactoryTestConceptPlugin");
QCOMPARE(nullptr, concept);
QCOMPARE(0, d->factory.keys().count());
}
void dtkCorePluginFactoryTestCase::cleanup(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment