summaryrefslogtreecommitdiff
path: root/indra/llui/llmenugl.h
diff options
context:
space:
mode:
authorsimon <none@none>2014-06-17 10:40:42 -0700
committersimon <none@none>2014-06-17 10:40:42 -0700
commit592024b5805a116c9d0bef893127427df0741b41 (patch)
treebcadc0685873b40e23254cf3d6232e8f1f3f0e1b /indra/llui/llmenugl.h
parent9e855b03b7f285794520eaf781b6a963b6cd51d9 (diff)
parent977476171ddcc057d7c28b6c14ae988b8189ed75 (diff)
Merge viewer-release and become version 3.7.9
Diffstat (limited to 'indra/llui/llmenugl.h')
-rwxr-xr-xindra/llui/llmenugl.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h
index feafaab199..ae9b169691 100755
--- a/indra/llui/llmenugl.h
+++ b/indra/llui/llmenugl.h
@@ -895,7 +895,8 @@ class view_listener_t : public boost::signals2::trackable
{
public:
virtual bool handleEvent(const LLSD& userdata) = 0;
- virtual ~view_listener_t() {}
+ view_listener_t() { sListeners.insert(this); }
+ virtual ~view_listener_t() { sListeners.erase(this); }
static void addEnable(view_listener_t* listener, const std::string& name)
{
@@ -913,6 +914,20 @@ public:
addEnable(listener, name);
addCommit(listener, name);
}
+
+ static void cleanup()
+ {
+ listener_vector_t listeners(sListeners.begin(), sListeners.end());
+ sListeners.clear();
+
+ std::for_each(listeners.begin(), listeners.end(), DeletePointer());
+ listeners.clear();
+ }
+
+private:
+ typedef std::set<view_listener_t*> listener_map_t;
+ typedef std::vector<view_listener_t*> listener_vector_t;
+ static listener_map_t sListeners;
};
#endif // LL_LLMENUGL_H