aboutsummaryrefslogtreecommitdiff
path: root/src/Slit.hh
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-07-02 15:21:24 (GMT)
committerPavel Labath <pavelo@centrum.sk>2011-11-01 09:57:20 (GMT)
commitf2709b26d8af7292f750fc05525ac90ad0d99c41 (patch)
tree794903544922abe2b90af6250de24124cd94d546 /src/Slit.hh
parent0584414d3845239202d5ea02da2ce6fb5b1b0cbb (diff)
downloadfluxbox_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/Slit.hh')
-rw-r--r--src/Slit.hh8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Slit.hh b/src/Slit.hh
index 9384ad6..f12a740 100644
--- a/src/Slit.hh
+++ b/src/Slit.hh
@@ -117,7 +117,7 @@ public:
117 Placement placement() const { return *m_rc_placement; } 117 Placement placement() const { return *m_rc_placement; }
118 int getOnHead() const { return *m_rc_on_head; } 118 int getOnHead() const { return *m_rc_on_head; }
119 void saveOnHead(int head); 119 void saveOnHead(int head);
120 FbTk::Menu &menu() { return m_slitmenu; } 120 FbTk::Menu &menu() { return *m_slitmenu; }
121 121
122 const FbTk::FbWindow &window() const { return frame.window; } 122 const FbTk::FbWindow &window() const { return frame.window; }
123 123
@@ -147,10 +147,10 @@ private:
147 BScreen &m_screen; 147 BScreen &m_screen;
148 FbTk::Timer m_timer; 148 FbTk::Timer m_timer;
149 149
150 std::auto_ptr<LayerMenu> m_layermenu; 150 FbTk::RefCount<LayerMenu> m_layermenu;
151 FbMenu m_clientlist_menu, m_slitmenu; 151 FbTk::RefCount<FbMenu> m_clientlist_menu, m_slitmenu;
152#ifdef XINERAMA 152#ifdef XINERAMA
153 XineramaHeadMenu<Slit> *m_xineramaheadmenu; 153 FbTk::RefCount<XineramaHeadMenu<Slit> > m_xineramaheadmenu;
154#endif // XINERAMA 154#endif // XINERAMA
155 155
156 struct frame { 156 struct frame {