summaryrefslogtreecommitdiff
path: root/plugins/TopToolBar/toolbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TopToolBar/toolbar.cpp')
-rw-r--r--plugins/TopToolBar/toolbar.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/TopToolBar/toolbar.cpp b/plugins/TopToolBar/toolbar.cpp
index 17e5028df0..7161d26c9b 100644
--- a/plugins/TopToolBar/toolbar.cpp
+++ b/plugins/TopToolBar/toolbar.cpp
@@ -185,7 +185,9 @@ INT_PTR TTBRemoveButton(WPARAM wParam, LPARAM lParam)
RemoveFromOptions(b->id);
- Buttons.remove(b);
+ int idx = Buttons.getIndex(b);
+ if (idx != -1)
+ Buttons.remove(idx);
delete b;
ArrangeButtons();