diff options
| author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2024-12-11 22:21:49 +0200 | 
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2024-12-12 14:39:51 +0200 | 
| commit | 9f47542597b2902a500be11e8083c608db39350a (patch) | |
| tree | d38c57b64229edf6da33ddef091f7a394d3db243 | |
| parent | 0dda1b019985312b88cc72fb3bec44e73a6c666b (diff) | |
#3265 Crash at getAllowEnvironmentOverride
Check region pointer and make sure external callbacks get disconected
| -rw-r--r-- | indra/newview/llfloaterregioninfo.cpp | 10 | ||||
| -rw-r--r-- | indra/newview/llfloaterregioninfo.h | 4 | ||||
| -rw-r--r-- | indra/newview/llpanelenvironment.cpp | 14 | 
3 files changed, 19 insertions, 9 deletions
| diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index efeee1ad3c..3239921259 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -2100,8 +2100,14 @@ LLPanelEstateInfo::LLPanelEstateInfo()      mEstateID(0)    // invalid  {      LLEstateInfoModel& estate_info = LLEstateInfoModel::instance(); -    estate_info.setCommitCallback(boost::bind(&LLPanelEstateInfo::refreshFromEstate, this)); -    estate_info.setUpdateCallback(boost::bind(&LLPanelEstateInfo::refreshFromEstate, this)); +    mEstateInfoCommitConnection = estate_info.setCommitCallback(boost::bind(&LLPanelEstateInfo::refreshFromEstate, this)); +    mEstateInfoUpdateConnection = estate_info.setUpdateCallback(boost::bind(&LLPanelEstateInfo::refreshFromEstate, this)); +} + +LLPanelEstateInfo::~LLPanelEstateInfo() +{ +    mEstateInfoCommitConnection.disconnect(); +    mEstateInfoUpdateConnection.disconnect();  }  // static diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index 65c1291728..201d8b0a68 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -320,7 +320,7 @@ public:      bool onMessageCommit(const LLSD& notification, const LLSD& response);      LLPanelEstateInfo(); -    ~LLPanelEstateInfo() {} +    ~LLPanelEstateInfo();      void updateControls(LLViewerRegion* region); @@ -352,6 +352,8 @@ protected:      bool checkSunHourSlider(LLUICtrl* child_ctrl);      U32 mEstateID; +    boost::signals2::connection mEstateInfoCommitConnection; +    boost::signals2::connection mEstateInfoUpdateConnection;  };  ///////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp index d3df88b65e..831ad7827a 100644 --- a/indra/newview/llpanelenvironment.cpp +++ b/indra/newview/llpanelenvironment.cpp @@ -359,12 +359,14 @@ void LLPanelEnvironmentInfo::refresh()  void LLPanelEnvironmentInfo::refreshFromEstate()  { -    LLViewerRegion *pRegion = gAgent.getRegion(); - -    bool oldAO = mAllowOverride; -    mAllowOverride = (isRegion() && LLEstateInfoModel::instance().getAllowEnvironmentOverride()) || pRegion->getAllowEnvironmentOverride(); -    if (oldAO != mAllowOverride) -        refresh(); +    LLViewerRegion* pRegion = gAgent.getRegion(); +    if (pRegion) +    { +        bool oldAO = mAllowOverride; +        mAllowOverride = (isRegion() && LLEstateInfoModel::instance().getAllowEnvironmentOverride()) || pRegion->getAllowEnvironmentOverride(); +        if (oldAO != mAllowOverride) +            refresh(); +    }  }  std::string LLPanelEnvironmentInfo::getNameForTrackIndex(U32 index) | 
