]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix crash when closing split view with ownCloud plugin loaded
authorMartin T. H. Sandsmark <martin.sandsmark@kde.org>
Sun, 15 May 2016 16:09:09 +0000 (18:09 +0200)
committerMartin T. H. Sandsmark <martin.sandsmark@kde.org>
Sat, 21 May 2016 16:16:41 +0000 (18:16 +0200)
KPluginLoader::instantiatePlugins() wraps QPluginLoader::instace(),
which doesn't return a new object for each call, so if we set the
KFileItemModelRolesUpdater instance as parent to the plugin the shared
instance will be deleted leading to crashes when other instances of
KFileItemModelRolesUpdater tries to use their plugin objects.

To fix this, set the QApplication as a parent.

BUG: 357479

REVIEW: 127930

src/kitemviews/kfileitemmodelrolesupdater.cpp

index e5353dc2a02adb67d2dfe6f1d3a3b8700dc2768b..fe30f62f967372c403519d352d9b2277f6a435c8 100644 (file)
@@ -133,7 +133,7 @@ KFileItemModelRolesUpdater::KFileItemModelRolesUpdater(KFileItemModel* model, QO
     connect(m_directoryContentsCounter, &KDirectoryContentsCounter::result,
             this,                       &KFileItemModelRolesUpdater::slotDirectoryContentsCountReceived);
 
-    auto plugins = KPluginLoader::instantiatePlugins(QStringLiteral("kf5/overlayicon"), nullptr, this);
+    auto plugins = KPluginLoader::instantiatePlugins(QStringLiteral("kf5/overlayicon"), nullptr, qApp);
     foreach (QObject *it, plugins) {
         auto plugin = qobject_cast<KOverlayIconPlugin*>(it);
         if (plugin) {