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; }