From e3cab4cc26e1c794a491d157a35772b68d1e6e10 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Wed, 3 Feb 2010 08:27:33 +0000 Subject: [PATCH] be sure to remove the tool from the tool collection if it gets deleted because the action was removed svn path=/branches/KDE/4.4/kdelibs/; revision=1084456 --- private/internaltoolbox.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/private/internaltoolbox.cpp b/private/internaltoolbox.cpp index ad65a46f1..e78daf690 100644 --- a/private/internaltoolbox.cpp +++ b/private/internaltoolbox.cpp @@ -167,7 +167,16 @@ void InternalToolBox::addTool(QAction *action) void InternalToolBox::updateToolBox() { Plasma::IconWidget *tool = qobject_cast(sender()); - if (tool && tool->action() == 0) { + if (tool && !tool->action()) { + QMutableMapIterator it(d->tools); + while (it.hasNext()) { + it.next(); + if (it.value() == tool) { + it.remove(); + break; + } + } + tool->deleteLater(); tool = 0; }