if (m_updateItemStatesThread != 0) {
disconnect(m_updateItemStatesThread, SIGNAL(finished()),
this, SLOT(applyUpdatedItemStates()));
- m_updateItemStatesThread->deleteWhenFinished();
+ if (m_updateItemStatesThread->isFinished()) {
+ delete m_updateItemStatesThread;
+ } else {
+ m_updateItemStatesThread->deleteWhenFinished();
+ }
m_updateItemStatesThread = 0;
}
+
+ m_plugin->disconnect();
+ m_plugin = 0;
}
QList<QAction*> VersionControlObserver::contextMenuActions(const KFileItemList& items) const
{
Q_ASSERT(m_plugin != 0);
if (m_updateItemStatesThread == 0) {
- m_updateItemStatesThread = new UpdateItemStatesThread(this);
+ m_updateItemStatesThread = new UpdateItemStatesThread();
connect(m_updateItemStatesThread, SIGNAL(finished()),
this, SLOT(applyUpdatedItemStates()));
}