diff options
Diffstat (limited to 'indra/llui/llmenugl.h')
-rwxr-xr-x | indra/llui/llmenugl.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 51df5df1f8..ae9b169691 100755 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -82,7 +82,7 @@ protected: friend class LLUICtrlFactory; public: // LLView overrides - /*virtual*/ void handleVisibilityChange(BOOL new_visibility); + /*virtual*/ void onVisibilityChange(BOOL new_visibility); /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); @@ -637,7 +637,7 @@ public: virtual void updateBranchParent( LLView* parentp ); // LLView Functionality - virtual void handleVisibilityChange( BOOL curVisibilityIn ); + virtual void onVisibilityChange( BOOL curVisibilityIn ); virtual void draw(); @@ -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 |