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-07-02 15:21:24 (GMT)
commit442e69c89b721329883113389f889675138e7da7 (patch)
tree211111eb98eb3da6155baea0a24c5cd9d8c6137d /src/Workspace.hh
parentbd94eaa6cadfd0a7d83f3068a84b27f987bdee4b (diff)
downloadfluxbox_pavel-442e69c89b721329883113389f889675138e7da7.zip
fluxbox_pavel-442e69c89b721329883113389f889675138e7da7.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