summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-02-24 00:54:57 +0200
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-02-25 15:28:02 +0200
commitd31de6afb2ac9f659efc13c438df727372fcac08 (patch)
tree9d8cd012b8e5cc3a15702a6881b0b71ee2152b0c
parent5dcc0606a8512159660c652cb25e7f29292f2df0 (diff)
Issue#884 Crash on ~LLSearchEditor
Crash seems to be specific to LLFilterEditor and only in a couple specific floaters. Based on older calltacks, commiting on exit was crashing. So I'm making sure that panels that potentially do not own the element in question clean the callback in case panels get deleted before the search editor.
-rw-r--r--indra/llui/llsearcheditor.cpp7
-rw-r--r--indra/llui/llsearcheditor.h2
-rw-r--r--indra/newview/llfloaterimsessiontab.cpp1
-rw-r--r--indra/newview/llpanelgrouproles.cpp4
-rw-r--r--indra/newview/llpanelgrouproles.h1
-rw-r--r--indra/newview/llpanelpeople.cpp13
-rw-r--r--indra/newview/llpanelpeople.h5
7 files changed, 26 insertions, 7 deletions
diff --git a/indra/llui/llsearcheditor.cpp b/indra/llui/llsearcheditor.cpp
index 78bd06b67e..13051998bd 100644
--- a/indra/llui/llsearcheditor.cpp
+++ b/indra/llui/llsearcheditor.cpp
@@ -104,6 +104,13 @@ LLSearchEditor::LLSearchEditor(const LLSearchEditor::Params& p)
}
}
+LLSearchEditor::~LLSearchEditor()
+{
+ mKeystrokeCallback = NULL;
+ mTextChangedCallback = NULL;
+ setCommitOnFocusLost(false);
+}
+
//virtual
void LLSearchEditor::draw()
{
diff --git a/indra/llui/llsearcheditor.h b/indra/llui/llsearcheditor.h
index b332967f9b..3f8c6323b0 100644
--- a/indra/llui/llsearcheditor.h
+++ b/indra/llui/llsearcheditor.h
@@ -74,7 +74,7 @@ protected:
friend class LLUICtrlFactory;
public:
- virtual ~LLSearchEditor() {}
+ virtual ~LLSearchEditor();
/*virtual*/ void draw();
diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp
index 6c2649984f..fd2d3095b3 100644
--- a/indra/newview/llfloaterimsessiontab.cpp
+++ b/indra/newview/llfloaterimsessiontab.cpp
@@ -470,7 +470,6 @@ void LLFloaterIMSessionTab::appendMessage(const LLChat& chat, const LLSD &args)
{
im_box->setTimeNow(mSessionID,chat.mFromID);
}
-
LLChat& tmp_chat = const_cast<LLChat&>(chat);
diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp
index b5d4712868..6c81eb3ea1 100644
--- a/indra/newview/llpanelgrouproles.cpp
+++ b/indra/newview/llpanelgrouproles.cpp
@@ -437,6 +437,7 @@ LLPanelGroupSubTab::LLPanelGroupSubTab()
LLPanelGroupSubTab::~LLPanelGroupSubTab()
{
+ mSearchCommitConnection.disconnect();
}
bool LLPanelGroupSubTab::postBuildSubTab(LLView* root)
@@ -469,7 +470,8 @@ bool LLPanelGroupSubTab::postBuild()
mSearchEditor = findChild<LLFilterEditor>("filter_input", recurse);
if (mSearchEditor) // SubTab doesn't implement this, only some of derived classes
{
- mSearchEditor->setCommitCallback(boost::bind(&LLPanelGroupSubTab::setSearchFilter, this, _2));
+ // panel
+ mSearchCommitConnection = mSearchEditor->setCommitCallback(boost::bind(&LLPanelGroupSubTab::setSearchFilter, this, _2));
}
return LLPanelGroupTab::postBuild();
diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h
index a4ae81eb60..3fa96213e5 100644
--- a/indra/newview/llpanelgrouproles.h
+++ b/indra/newview/llpanelgrouproles.h
@@ -136,6 +136,7 @@ protected:
LLPanel* mFooter;
LLFilterEditor* mSearchEditor;
+ boost::signals2::connection mSearchCommitConnection;
std::string mSearchFilter;
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index a480c79504..da2206aefb 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -577,6 +577,11 @@ LLPanelPeople::~LLPanelPeople()
delete mFriendListUpdater;
delete mRecentListUpdater;
+ mNearbyFilterCommitConnection.disconnect();
+ mFriedsFilterCommitConnection.disconnect();
+ mGroupsFilterCommitConnection.disconnect();
+ mRecentFilterCommitConnection.disconnect();
+
if(LLVoiceClient::instanceExists())
{
LLVoiceClient::getInstance()->removeObserver(this);
@@ -613,10 +618,10 @@ bool LLPanelPeople::postBuild()
{
S32 max_premium = LLAgentBenefitsMgr::get("Premium").getGroupMembershipLimit();
- getChild<LLFilterEditor>("nearby_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
- getChild<LLFilterEditor>("friends_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
- getChild<LLFilterEditor>("groups_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
- getChild<LLFilterEditor>("recent_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
+ mNearbyFilterCommitConnection = getChild<LLFilterEditor>("nearby_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
+ mFriedsFilterCommitConnection = getChild<LLFilterEditor>("friends_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
+ mGroupsFilterCommitConnection = getChild<LLFilterEditor>("groups_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
+ mRecentFilterCommitConnection = getChild<LLFilterEditor>("recent_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
if(LLAgentBenefitsMgr::current().getGroupMembershipLimit() < max_premium)
{
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index 807384f50c..058f34aa2f 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -147,6 +147,11 @@ private:
Updater* mRecentListUpdater;
Updater* mButtonsUpdater;
LLHandle< LLFloater > mPicker;
+
+ boost::signals2::connection mNearbyFilterCommitConnection;
+ boost::signals2::connection mFriedsFilterCommitConnection;
+ boost::signals2::connection mGroupsFilterCommitConnection;
+ boost::signals2::connection mRecentFilterCommitConnection;
};
#endif //LL_LLPANELPEOPLE_H