From: Martin T. H. Sandsmark Date: Sun, 15 May 2016 16:09:09 +0000 (+0200) Subject: Fix crash when closing split view with ownCloud plugin loaded X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/b1471bbd09d88da3ffe8159075b3108bf9586220?hp=b7ad5fb99d32d43fe4e083a8ffc2ebfbd046d2db Fix crash when closing split view with ownCloud plugin loaded 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 --- diff --git a/src/kitemviews/kfileitemmodelrolesupdater.cpp b/src/kitemviews/kfileitemmodelrolesupdater.cpp index e5353dc2a..fe30f62f9 100644 --- a/src/kitemviews/kfileitemmodelrolesupdater.cpp +++ b/src/kitemviews/kfileitemmodelrolesupdater.cpp @@ -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(it); if (plugin) {