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

Plugins are shared among QPluginLoader instances. The root components must not...

Plugins are shared among QPluginLoader instances. The root components must not be deleted in the PluginManager dtor, otherwise dangling pointers appear in other PluginManager instances (leads to double deletion attempts). This affects at least applications using more than one MarbleWidget (e.g. digikam).
CCBUG: 235238
Backport of commit 1123153.
CCBUG: 234311

svn path=/branches/KDE/4.4/kdeedu/marble/; revision=1125543
parent bf263bce
......@@ -50,8 +50,13 @@ PluginManager::PluginManager( QObject *parent )
PluginManager::~PluginManager()
{
qDeleteAll( d->m_renderPluginTemplates );
qDeleteAll( d->m_networkPluginTemplates );
// The plugin instances returned by QPluginLoader are shared by all QPluginLoaders.
// If more than one MarbleWidget is used, deleting them here leads to dangling
// pointers and double deletions in the other PluginManagers.
// TODO: According to QPluginLoader::unload deletion happens automatically on application
// termination, but it should be checked that this really is the case (and remove this TODO)
//qDeleteAll( d->m_renderPluginTemplates );
//qDeleteAll( d->m_networkPluginTemplates );
delete d;
}
......
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