From 460c6e1d360d1515d5cc53448e8bdf2db19946c7 Mon Sep 17 00:00:00 2001 From: Waldo Bastian Date: Thu, 15 Feb 2001 23:19:07 +0000 Subject: [PATCH] Don't crash when changing decorations with RMB. svn path=/trunk/kdebase/kwin/; revision=83040 --- plugins.cpp | 4 +++- plugins.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) 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: