diff options
author | simon <none@none> | 2014-06-17 10:40:42 -0700 |
---|---|---|
committer | simon <none@none> | 2014-06-17 10:40:42 -0700 |
commit | 592024b5805a116c9d0bef893127427df0741b41 (patch) | |
tree | bcadc0685873b40e23254cf3d6232e8f1f3f0e1b /indra/llui/llmenugl.h | |
parent | 9e855b03b7f285794520eaf781b6a963b6cd51d9 (diff) | |
parent | 977476171ddcc057d7c28b6c14ae988b8189ed75 (diff) |
Merge viewer-release and become version 3.7.9
Diffstat (limited to 'indra/llui/llmenugl.h')
-rwxr-xr-x | indra/llui/llmenugl.h | 17 |
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 |