aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/MenuItem.cc
diff options
context:
space:
mode:
authormarkt <markt>2007-09-08 18:38:30 (GMT)
committermarkt <markt>2007-09-08 18:38:30 (GMT)
commit16218ae90b2499773d0c49a8c2900f269f5a2974 (patch)
treeb0bff08ecdd983808eeec136700bd27ea16ae03a /src/FbTk/MenuItem.cc
parentadddf014bd80d5ea7595fc1e8df233a857b8d90f (diff)
downloadfluxbox-16218ae90b2499773d0c49a8c2900f269f5a2974.zip
fluxbox-16218ae90b2499773d0c49a8c2900f269f5a2974.tar.bz2
fix crash when changing toolbar visibility with empty toolbar.tools
Diffstat (limited to 'src/FbTk/MenuItem.cc')
-rw-r--r--src/FbTk/MenuItem.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/FbTk/MenuItem.cc b/src/FbTk/MenuItem.cc
index 82dd155..bc80ca0 100644
--- a/src/FbTk/MenuItem.cc
+++ b/src/FbTk/MenuItem.cc
@@ -34,8 +34,11 @@
34namespace FbTk { 34namespace FbTk {
35 35
36void MenuItem::click(int button, int time) { 36void MenuItem::click(int button, int time) {
37 if (m_command.get() != 0) 37 if (m_command.get() != 0) {
38 m_command->execute(); 38 // we need a local variable, since the command may destroy this object
39 RefCount<Command> tmp(m_command);
40 tmp->execute();
41 }
39} 42}
40 43
41void MenuItem::drawLine(FbDrawable &draw, const MenuTheme &theme, size_t size, 44void MenuItem::drawLine(FbDrawable &draw, const MenuTheme &theme, size_t size,