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

List:       kde-commits
Subject:    KDE/kdenetwork/kopete/kopete
From:       Pali Rohár <pali.rohar () gmail ! com>
Date:       2013-06-02 9:00:51
Message-ID: 20130602090051.EFFB4AC85D () svn ! kde ! org
[Download RAW message or body]

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<KMainWindow*> members = KMainWindow::memberList();
+		QList<KMainWindow*>::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";


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

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