From kde-commits Sun Jun 02 09:00:51 2013 From: =?utf-8?q?Pali=20Roh=C3=A1r?= Date: Sun, 02 Jun 2013 09:00:51 +0000 To: kde-commits Subject: KDE/kdenetwork/kopete/kopete Message-Id: <20130602090051.EFFB4AC85D () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=137016363922125 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";