diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-07-02 15:21:24 (GMT) |
---|---|---|
committer | Pavel Labath <pavelo@centrum.sk> | 2011-11-01 09:57:20 (GMT) |
commit | f2709b26d8af7292f750fc05525ac90ad0d99c41 (patch) | |
tree | 794903544922abe2b90af6250de24124cd94d546 /src/FbTk/MultiButtonMenuItem.cc | |
parent | 0584414d3845239202d5ea02da2ce6fb5b1b0cbb (diff) | |
download | fluxbox_paul-f2709b26d8af7292f750fc05525ac90ad0d99c41.zip fluxbox_paul-f2709b26d8af7292f750fc05525ac90ad0d99c41.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.cc')
-rw-r--r-- | src/FbTk/MultiButtonMenuItem.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/FbTk/MultiButtonMenuItem.cc b/src/FbTk/MultiButtonMenuItem.cc index 1b61a99..b10ba07 100644 --- a/src/FbTk/MultiButtonMenuItem.cc +++ b/src/FbTk/MultiButtonMenuItem.cc | |||
@@ -33,7 +33,8 @@ MultiButtonMenuItem::MultiButtonMenuItem(int buttons, const FbTk::BiDiString &la | |||
33 | init(buttons); | 33 | init(buttons); |
34 | } | 34 | } |
35 | 35 | ||
36 | MultiButtonMenuItem::MultiButtonMenuItem(int buttons, const FbTk::BiDiString &label, Menu *submenu): | 36 | MultiButtonMenuItem::MultiButtonMenuItem(int buttons, const FbTk::BiDiString &label, |
37 | const RefCount<Menu> &submenu): | ||
37 | MenuItem(label, submenu), | 38 | MenuItem(label, submenu), |
38 | m_button_exe(0), | 39 | m_button_exe(0), |
39 | m_buttons(buttons) { | 40 | m_buttons(buttons) { |