Browse Source

Delete ctkPluginActivator on plugin stop.

Sascha Zelzer 14 years ago
parent
commit
ef5af58eec
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Libs/PluginFramework/ctkPluginPrivate.cpp

+ 5 - 0
Libs/PluginFramework/ctkPluginPrivate.cpp

@@ -274,6 +274,7 @@ void ctkPluginPrivate::stop0(bool wasStarted)
   state = ctkPlugin::STOPPING;
   deactivating = true;
   //6-13:
+  ctkPluginActivator* activator = 0;
   const std::exception* savedException = 0;
   try
   {
@@ -296,6 +297,7 @@ void ctkPluginPrivate::stop0(bool wasStarted)
       {
         throw std::logic_error("Plugin is uninstalled");
       }
+      activator = pluginActivator;
       pluginActivator = 0;
     }
 
@@ -316,11 +318,14 @@ void ctkPluginPrivate::stop0(bool wasStarted)
     savedException = exc;
   }
 
+  delete activator;
+
   if (state != ctkPlugin::UNINSTALLED)
   {
     state = ctkPlugin::RESOLVED;
     deactivating = false;
     //fwCtx.packages.notifyAll();
+    fwCtx->listeners.emitPluginChanged(ctkPluginEvent(ctkPluginEvent::STOPPED, q_func()));
   }
 
   if (savedException)