aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/MultiButtonMenuItem.hh
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-07-02 15:21:24 (GMT)
committerPavel Labath <pavelo@centrum.sk>2013-02-17 00:09:35 (GMT)
commitb9de0c5be3022db926e167fbe765dc222c1db828 (patch)
tree3af2cb3b644e2986d904f486fe73a5e158757009 /src/FbTk/MultiButtonMenuItem.hh
parentdb435c66cce9644abf5599f62229426b1f09a9e3 (diff)
downloadfluxbox_pavel-b9de0c5be3022db926e167fbe765dc222c1db828.zip
fluxbox_pavel-b9de0c5be3022db926e167fbe765dc222c1db828.tar.bz2
Store menus if smart pointers (RefCount)
This was originally intended to be a bugfix for an memory error reported by valgrind (accessing freed memory). While debugging it, I found the menu ownership semantics confusing (setInternalMenu() et al.), so I decided to get rid of it and store it in smart pointers everywhere. Looking back, I'm not sure if this was worth all the trouble, but the good news is that the valgrind error disappeared. :)
Diffstat (limited to 'src/FbTk/MultiButtonMenuItem.hh')
-rw-r--r--src/FbTk/MultiButtonMenuItem.hh2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/FbTk/MultiButtonMenuItem.hh b/src/FbTk/MultiButtonMenuItem.hh
index 0a9c5e6..427302c 100644
--- a/src/FbTk/MultiButtonMenuItem.hh
+++ b/src/FbTk/MultiButtonMenuItem.hh
@@ -31,7 +31,7 @@ namespace FbTk {
31class MultiButtonMenuItem: public FbTk::MenuItem { 31class MultiButtonMenuItem: public FbTk::MenuItem {
32public: 32public:
33 MultiButtonMenuItem(int buttons, const FbTk::BiDiString& label); 33 MultiButtonMenuItem(int buttons, const FbTk::BiDiString& label);
34 MultiButtonMenuItem(int buttons, const FbTk::BiDiString& label, Menu *submenu); 34 MultiButtonMenuItem(int buttons, const FbTk::BiDiString& label, const RefCount<Menu> &submenu);
35 virtual ~MultiButtonMenuItem(); 35 virtual ~MultiButtonMenuItem();
36 /// sets command to specified button 36 /// sets command to specified button
37 void setCommand(int button, FbTk::RefCount<FbTk::Command<void> > &cmd); 37 void setCommand(int button, FbTk::RefCount<FbTk::Command<void> > &cmd);