diff --git a/plugins.cpp b/plugins.cpp index f2df852d11..fe9ff6ca52 100644 --- a/plugins.cpp +++ b/plugins.cpp @@ -102,7 +102,9 @@ void PluginMenu::slotActivated(int id) config->setGroup("Style"); config->writeEntry("PluginLib", newPlugin); config->sync(); - mgr->loadPlugin(newPlugin); + // We can't do this directly because we might destruct a client + // underneath our own feet while doing so. + QTimer::singleShot(0, mgr, SLOT(updatePlugin())); } PluginMgr::PluginMgr() diff --git a/plugins.h b/plugins.h index 444e9af34d..a340793ac5 100644 --- a/plugins.h +++ b/plugins.h @@ -24,8 +24,9 @@ public: ~PluginMgr(); Client *allocateClient(Workspace *ws, WId w, bool tool); void loadPlugin(QString name); - bool updatePlugin(); QString currentPlugin() { return pluginStr; } +public slots: + bool updatePlugin(); signals: void resetAllClients(); protected: