[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepim/kontact/src
From:       Sergio Luis Martins <iamsergio () gmail ! com>
Date:       2009-04-01 21:50:12
Message-ID: 1238622612.124511.18509.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 947994 by smartins:

Fix plugin loading and/or unloading segfault.

CCMAIL: ereslibre@kde.org
CCBUG: 180007


 M  +4 -6      mainwindow.cpp  


--- trunk/KDE/kdepim/kontact/src/mainwindow.cpp #947993:947994
@@ -580,7 +580,6 @@
 bool MainWindow::removePlugin( const KPluginInfo &info )
 {
   PluginList::Iterator end = mPlugins.end();
-  ActionPluginList::Iterator it2 = mActionPlugins.begin();
   for ( PluginList::Iterator it = mPlugins.begin(); it != end; ++it ) {
     Plugin *plugin = *it;
     if ( ( *it )->identifier() == info.pluginName() ) {
@@ -609,8 +608,10 @@
       plugin->deleteLater(); // removes the part automatically
       mPlugins.erase( it );
       if ( plugin->showInSideBar() ) {
-        delete *it2; // remove the KAction, so we free the shortcut for later us
-        mActionPlugins.erase( it2 );
+        QAction *q = mPluginAction[plugin]; // remove the KAction, so we free the shortcut for later us
+        mActionPlugins.remove( q );
+        mPluginAction.remove(plugin);
+        delete q;
       }
 
       if ( mCurrentPlugin == 0 ) {
@@ -625,9 +626,6 @@
       return true;
     }
 
-    if ( plugin->showInSideBar() ) {
-      it2++;
-    }
   }
 
   return false;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic