SVN commit 1356779 by pali: Try to cleanly quit kopete (without crash) when proper shutdown was not called (e.g. quit from dbus) Close all kopete windows, shutdown plugin manager and delete all kopete plugins until KopeteApplication is alive and main Qt loop is running (this is needed for more kopete plugins) M +20 -0 kopeteapplication.cpp --- trunk/KDE/kdenetwork/kopete/kopete/kopeteapplication.cpp #1356778:1356779 @@ -104,6 +104,26 @@ { kDebug( 14000 ) ; + if ( ! m_isShuttingDown ) + { + // destruct was called without proper shutdown, dbus quit maybe? + m_isShuttingDown = true; + + // close all windows + QList members = KMainWindow::memberList(); + QList::iterator it, itEnd = members.end(); + for ( it = members.begin(); it != itEnd; ++it ) + (*it)->close(); + + // shutdown plugin manager + Kopete::PluginManager::self()->shutdown(); + + // destroy all plugins until KopeteApplication is alive + Kopete::PluginList list = Kopete::PluginManager::self()->loadedPlugins(); + foreach ( Kopete::Plugin *plugin, list ) + delete plugin; + } + delete m_fileEngineHandler; delete m_emoticonHandler; //kDebug( 14000 ) << "Done";