From 0e346960bb45900cf1d9472834687c9b7b928e1f Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 17 Dec 2013 13:05:12 -0500 Subject: add LLAgent::removeRegionChangedCallback --- indra/newview/llagent.cpp | 4 ++++ indra/newview/llagent.h | 1 + 2 files changed, 5 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 6ee8f26b9f..b1cd68140e 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -981,6 +981,10 @@ boost::signals2::connection LLAgent::addRegionChangedCallback(region_changed_cal return mRegionChangedSignal.connect(cb); } +void LLAgent::removeRegionChangedCallback(boost::signals2::connection callback) +{ + mRegionChangedSignal.disconnect(callback); +} //----------------------------------------------------------------------------- // inPrelude() diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 0662be897a..bc003387de 100755 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -273,6 +273,7 @@ private: */ typedef boost::function region_changed_callback_t; boost::signals2::connection addRegionChangedCallback(region_changed_callback_t); + void removeRegionChangedCallback(boost::signals2::connection callback); private: LLViewerRegion *mRegionp; -- cgit v1.2.3 From 1886428638c2cb1e82db9f97ad311c2a506677a6 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Wed, 18 Dec 2013 06:26:22 +0000 Subject: STORM-1831 Changing addRegionChangedCallback to more closely resemble the feature it replaces. This fixes the crashes reported by Whirly ;-) --- indra/newview/llagent.cpp | 2 +- indra/newview/llagent.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index b1cd68140e..14a2508697 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -976,7 +976,7 @@ LLHost LLAgent::getRegionHost() const } } -boost::signals2::connection LLAgent::addRegionChangedCallback(region_changed_callback_t cb) +boost::signals2::connection LLAgent::addRegionChangedCallback(const region_changed_signal_t::slot_type& cb) { return mRegionChangedSignal.connect(cb); } diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index bc003387de..0766407494 100755 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -271,13 +271,13 @@ private: * // you may or may not want to remove that callback * } */ - typedef boost::function region_changed_callback_t; - boost::signals2::connection addRegionChangedCallback(region_changed_callback_t); + typedef boost::signals2::signal region_changed_signal_t; + + boost::signals2::connection addRegionChangedCallback(const region_changed_signal_t::slot_type& cb); void removeRegionChangedCallback(boost::signals2::connection callback); private: LLViewerRegion *mRegionp; - typedef boost::signals2::signal region_changed_signal_t; region_changed_signal_t mRegionChangedSignal; //-------------------------------------------------------------------- -- cgit v1.2.3