diff options
author | markt <markt> | 2007-09-08 18:38:30 (GMT) |
---|---|---|
committer | markt <markt> | 2007-09-08 18:38:30 (GMT) |
commit | 16218ae90b2499773d0c49a8c2900f269f5a2974 (patch) | |
tree | b0bff08ecdd983808eeec136700bd27ea16ae03a /src/FbTk/MenuItem.cc | |
parent | adddf014bd80d5ea7595fc1e8df233a857b8d90f (diff) | |
download | fluxbox-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.cc | 7 |
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 @@ | |||
34 | namespace FbTk { | 34 | namespace FbTk { |
35 | 35 | ||
36 | void MenuItem::click(int button, int time) { | 36 | void 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 | ||
41 | void MenuItem::drawLine(FbDrawable &draw, const MenuTheme &theme, size_t size, | 44 | void MenuItem::drawLine(FbDrawable &draw, const MenuTheme &theme, size_t size, |