Commit e70da70a authored by Dennis Nienhüser's avatar Dennis Nienhüser
Browse files

Add a debug message when all plugins were unloaded to help track down crashes...

Add a debug message when all plugins were unloaded to help track down crashes which depend on the order of destruction.

svn path=/trunk/KDE/kdeedu/marble/; revision=1196433
parent eb02a737
......@@ -49,24 +49,31 @@ class PluginManagerPrivate
QMap<QPluginLoader*, RunnerPlugin *> m_runnerPlugins;
private:
void cleanup( const QList<QPluginLoader*> loaders );
bool cleanup( const QList<QPluginLoader*> loaders );
};
PluginManagerPrivate::~PluginManagerPrivate()
{
QMap<QPluginLoader*, RunnerPlugin *>::const_iterator i = m_runnerPlugins.constBegin();
cleanup( m_renderPluginTemplates.keys() );
cleanup( m_networkPluginTemplates.keys() );
cleanup( m_positionProviderPluginTemplates.keys() );
cleanup( m_runnerPlugins.keys() );
bool allUnloaded = cleanup( m_renderPluginTemplates.keys() );
allUnloaded = allUnloaded && cleanup( m_networkPluginTemplates.keys() );
allUnloaded = allUnloaded && cleanup( m_positionProviderPluginTemplates.keys() );
allUnloaded = allUnloaded && cleanup( m_runnerPlugins.keys() );
if ( allUnloaded ) {
mDebug() << "All plugins unloaded. Plugin instances still alive will crash now.";
}
}
void PluginManagerPrivate::cleanup( const QList<QPluginLoader*> loaders )
bool PluginManagerPrivate::cleanup( const QList<QPluginLoader*> loaders )
{
bool allUnloaded = true;
foreach( QPluginLoader* loader, loaders ) {
loader->unload();
allUnloaded = allUnloaded && loader->unload();
delete loader;
}
return allUnloaded;
}
PluginManager::PluginManager( QObject *parent )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment