From 62ac5cd17b00a5e85eb629c4cce44b6f57d6a7fc Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Fri, 9 Sep 2016 12:26:15 +0100 Subject: [PATCH] Fix applets not being added on service restart Summary: Applet::destroy doesn't delete the applet from Containment::applets in the same event. Potentially a dbus activated service being restarted can be added in this time, causing us to try adding a new applet with the same ID before the first object is deleted. Reviewers: #plasma, mart Reviewed By: mart Subscribers: mart, plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D2703 --- applets/systemtray/systemtray.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/applets/systemtray/systemtray.cpp b/applets/systemtray/systemtray.cpp index 66bb5b492..c36df8a65 100644 --- a/applets/systemtray/systemtray.cpp +++ b/applets/systemtray/systemtray.cpp @@ -109,7 +109,11 @@ void SystemTray::newTask(const QString &task) //only allow one instance per applet if (task == applet->pluginInfo().pluginName()) { - return; + //Applet::destroy doesn't delete the applet from Containment::applets in the same event + //potentially a dbus activated service being restarted can be added in this time. + if (!applet->destroyed()) { + return; + } } }