[Marble-commits] branches/KDE/4.4/kdeedu/marble/src/lib

Dennis Nienhüser earthwings at gentoo.org
Tue May 11 19:25:23 CEST 2010


SVN commit 1125543 by nienhueser:

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


 M  +7 -2      PluginManager.cpp  


--- branches/KDE/4.4/kdeedu/marble/src/lib/PluginManager.cpp #1125542:1125543
@@ -50,8 +50,13 @@
 
 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;
 }
 


More information about the Marble-commits mailing list