Problem which VCS plugins when closing a project

Robert Gruber R.Gruber at
Sun Dec 3 18:44:41 UTC 2006


today I recogniced a very strange behavior of KDevelop's VCS plugins in the latest version from branches/kdevelop/3.4. I was working on a project which uses the CvsServicePart. I changed some setting of the cvs-plugin, to show more than just 3 lines when diffing a file. I had to reopen my project and then all setting for the CvsServicePart had be restored to it's default values. The project-setting of any other plugin are beeing restored correctly.

After closing my project, on the shell I saw the following output:
kdevelop (core): dcop emitting project closed
kdevelop (core):  *** Removing: kdevcvsservice
kdevelop (core): [virtual void NewMainWindow::removeView(QWidget*)]  - view: [CvsProcessWidget pointer (0x8a82688) to widget cvsprocesswidget, geometry=100x56+0+12]
kdevelop (core): parentWidget: [KDockWidget pointer (0x8a9ed78) to widget cvsprocesswidget, geometry=100x68+0+0]

Scanning through the whole output I found that CvsServicePart's slotProjectClosed() never gets called, although it is correctly connected to KDevCore's projectClosed() signal.

So I debugged into ProjectManager::closeProject() and I think that I've found the problem.
To me it seams, that VCSManagerPart::projectClosed() gets called before CvsServicePart::slotProjectClosed(). Unfortunatly VCSManagerPart's projectClosed() method unloads the active VCS plugin (in my case CvsServicePart). And as far as unloading a plugin also means deleteing it's instance, the VCS-plugin gets deleted by VCSManagerPart before the projectClosed() signal reaches it.

This is the backtrace from the time the CvsServicePart instance get deleted:
(gdb) back
#0  PluginController::unloadPlugins (this=0x8176590, unloadParts=@0xbffa242c)
    at /home/rgruber/src/kdevelop_34/src/plugincontroller.cpp:192
#1  0xb7f5c9ab in PluginController::unloadPlugin (this=0x8176590, plugin=@0x8348fb4)
    at /home/rgruber/src/kdevelop_34/src/plugincontroller.cpp:312
#2  0xb5ca81ed in VCSManagerPart::unloadVCSPlugin ()
   from /opt/kde-3.5.4/lib/kde3/
#3  0xb5ca8225 in VCSManagerPart::projectClosed ()
   from /opt/kde-3.5.4/lib/kde3/
#4  0xb5ca8ca2 in VCSManagerPart::qt_invoke ()
   from /opt/kde-3.5.4/lib/kde3/
#5  0xb685db8c in QObject::activate_signal () from /opt/qt-3.3.6/lib/
#6  0xb685e0c0 in QObject::activate_signal () from /opt/qt-3.3.6/lib/
#7  0xb7ea426c in KDevCore::projectClosed () from /opt/kde-3.5.4/lib/
#8  0xb7f667e3 in Core::doEmitProjectClosed (this=0x8171668)
    at /home/rgruber/src/kdevelop_34/src/core.h:48
#9  0xb7f62762 in ProjectManager::closeProject (this=0x816c6e8, exiting=false)
    at /home/rgruber/src/kdevelop_34/src/projectmanager.cpp:324

Unfortunalty I have no idea how to fix this :-(

Best regards,

For my local copy I've added a call to slotProjectClosed() to CvsServicePart's destructor. That way the settings will be stored even if the plugin gets removed before the signal reaches it.

------ cut -------
Index: cvspart.cpp
--- cvspart.cpp (Revision 610182)
+++ cvspart.cpp (Arbeitskopie)
@@ -106,6 +106,8 @@

+    slotProjectClosed();
     delete m_cvsConfigurationForm;
     delete m_impl;
------ cut -------

"Ein Herz für Kinder" - Ihre Spende hilft! Aktion:
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!

More information about the KDevelop-devel mailing list