From 951ce0ad36e4bf2066c48941c00203463d3fe41d Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 18 Jul 2024 18:14:22 +0300 Subject: viewer#2061 Crash in ~LLScriptEdCore() --- indra/newview/llpreviewscript.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpreviewscript.cpp') diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index c2188ea638..b7c929f0b5 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -414,7 +414,13 @@ LLScriptEdCore::~LLScriptEdCore() if (script_search && script_search->getEditorCore() == this) { script_search->closeFloater(); - delete script_search; + // closeFloater can delete instance since it's not reusable nor single instance + // so make sure instance is still there before deleting + script_search = LLFloaterScriptSearch::getInstance(); + if (script_search) + { + delete script_search; + } } delete mLiveFile; -- cgit v1.2.3 From e5748df9a5f213ea6e3a7650719586e5f01233d9 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Sun, 18 Aug 2024 18:34:42 -0400 Subject: Fix findChild during draw in script editor --- indra/newview/llpreviewscript.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'indra/newview/llpreviewscript.cpp') diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index b7c929f0b5..02a4c7fb26 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -435,7 +435,7 @@ void LLLiveLSLEditor::experienceChanged() if(mScriptEd->getAssociatedExperience() != mExperiences->getSelectedValue().asUUID()) { mScriptEd->enableSave(getIsModifiable()); - //getChildView("Save_btn")->setEnabled(true); + //mSaveBtn->setEnabled(true); mScriptEd->setAssociatedExperience(mExperiences->getSelectedValue().asUUID()); updateExperiencePanel(); } @@ -481,6 +481,7 @@ void LLLiveLSLEditor::onToggleExperience( LLUICtrl *ui, void* userdata ) bool LLScriptEdCore::postBuild() { + mLineCol = getChild("line_col"); mErrorList = getChild("lsl errors"); mFunctions = getChild("Insert..."); @@ -490,7 +491,8 @@ bool LLScriptEdCore::postBuild() mEditor = getChild("Script Editor"); childSetCommitCallback("lsl errors", &LLScriptEdCore::onErrorList, this); - childSetAction("Save_btn", boost::bind(&LLScriptEdCore::doSave,this,false)); + mSaveBtn = getChild("Save_btn"); + mSaveBtn->setCommitCallback(boost::bind(&LLScriptEdCore::doSave, this, false)); childSetAction("Edit_btn", boost::bind(&LLScriptEdCore::openInExternalEditor, this)); initMenu(); @@ -711,7 +713,7 @@ bool LLScriptEdCore::hasChanged() void LLScriptEdCore::draw() { bool script_changed = hasChanged(); - getChildView("Save_btn")->setEnabled(script_changed && !mScriptRemoved); + mSaveBtn->setEnabled(script_changed && !mScriptRemoved); if( mEditor->hasFocus() ) { @@ -723,11 +725,11 @@ void LLScriptEdCore::draw() args["[LINE]"] = llformat ("%d", line); args["[COLUMN]"] = llformat ("%d", column); cursor_pos = LLTrans::getString("CursorPos", args); - getChild("line_col")->setValue(cursor_pos); + mLineCol->setValue(cursor_pos); } else { - getChild("line_col")->setValue(LLStringUtil::null); + mLineCol->setValue(LLStringUtil::null); } updateDynamicHelp(); -- cgit v1.2.3