aboutsummaryrefslogtreecommitdiff
path: root/src/Workspace.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/Workspace.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/Workspace.hh')
-rw-r--r--src/Workspace.hh6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Workspace.hh b/src/Workspace.hh
index 2dabb3e..829bdf0 100644
--- a/src/Workspace.hh
+++ b/src/Workspace.hh
@@ -65,8 +65,8 @@ public:
65 BScreen &screen() { return m_screen; } 65 BScreen &screen() { return m_screen; }
66 const BScreen &screen() const { return m_screen; } 66 const BScreen &screen() const { return m_screen; }
67 67
68 FbTk::Menu &menu() { return m_clientmenu; } 68 FbTk::RefCount<FbTk::Menu> menu() { return m_clientmenu; }
69 const FbTk::Menu &menu() const { return m_clientmenu; } 69 FbTk::RefCount<const FbTk::Menu> menu() const { return m_clientmenu; }
70 /// name of this workspace 70 /// name of this workspace
71 const FbTk::FbString &name() const { return m_name; } 71 const FbTk::FbString &name() const { return m_name; }
72 /** 72 /**
@@ -86,7 +86,7 @@ private:
86 86
87 Windows m_windowlist; 87 Windows m_windowlist;
88 FbTk::Signal<> m_clientlist_sig; 88 FbTk::Signal<> m_clientlist_sig;
89 ClientMenu m_clientmenu; 89 FbTk::RefCount<ClientMenu> m_clientmenu;
90 90
91 FbTk::FbString m_name; ///< name of this workspace 91 FbTk::FbString m_name; ///< name of this workspace
92 unsigned int m_id; ///< id, obsolete, this should be in BScreen 92 unsigned int m_id; ///< id, obsolete, this should be in BScreen