]> vaikene.ee Git - evaf/blobdiff - src/libs/Plugins/pluginmanager.cpp
Doxygen documentation fixes.
[evaf] / src / libs / Plugins / pluginmanager.cpp
index c357d114a3236b227ed0fd4cf05428a033c283f9..8ca6048f915eba56b5e7c9ed90936948e4ae6c9d 100644 (file)
@@ -312,7 +312,7 @@ bool PluginManagerPrivate::loadPlugins()
     // Initialize eVaf plugins
     i = 0;
     while (i < mPlugins.size()) {
-        if (mPlugins.at(i)->init()) {
+        if (!mPlugins.at(i)->init()) {
             EVAF_ERROR("Failed to initialize module '%s'", qPrintable(mPlugins.at(i)->name()));
             mPlugins.removeAt(i);
         }
@@ -405,10 +405,10 @@ Module::Module(QString const & name)
 
 Module::~Module()
 {
-    if (mPluginFactory)
-        delete mPluginFactory;
-    if (mLoader)
+    if (mLoader) {
+        mLoader->unload();
         delete mLoader;
+    }
 }
 
 bool Module::load()
@@ -430,7 +430,7 @@ bool Module::load()
     if ((mPluginFactory = qobject_cast<iPluginFactory *>(root)) == 0) {
 
         // If not, then it has to implement the iPlugin interface
-        if ((mPlugin = qobject_cast<iPlugin *>(root)) == 0) {
+        if (qobject_cast<iPlugin *>(root) == 0) {
             EVAF_FATAL_ERROR("Module '%s' is not a valid eVaf module", qPrintable(mName));
             return false;
         }
@@ -444,13 +444,10 @@ bool Module::load()
 void Module::unload()
 {
     mRoot = 0;
-
-    if (mPluginFactory) {
-        delete mPluginFactory;
-        mPluginFactory = 0;
-    }
+    mPluginFactory = 0;
     mPlugin = 0;
     if (mLoader) {
+        mLoader->unload();
         delete mLoader;
         mLoader = 0;
     }
@@ -509,8 +506,6 @@ Plugin::Plugin(Module * module, QString const & name, QString const & args)
 
 Plugin::~Plugin()
 {
-    if (mPlugin)
-        delete mPlugin;
 }
 
 bool Plugin::load()
@@ -523,10 +518,7 @@ bool Plugin::load()
 
 void Plugin::unload()
 {
-    if (mPlugin) {
-        delete mPlugin;
-        mPlugin = 0;
-    }
+    mPlugin = 0;
 }
 
 bool Plugin::init()