From 70aff2154b910afd9a8bdc14c72c4e058c8b1076 Mon Sep 17 00:00:00 2001 From: Cinder Date: Mon, 12 May 2014 07:23:52 -0600 Subject: Eliminate updateKeywords() --- indra/newview/llpreviewscript.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'indra/newview/llpreviewscript.cpp') diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index b300f3a39c..5e7b148101 100755 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -391,8 +391,14 @@ LLScriptEdCore::~LLScriptEdCore() } delete mLiveFile; - mRegionChangedCallback.disconnect(); - mFileFetchedCallback.disconnect(); + if (mRegionChangedCallback.connected()) + { + mRegionChangedCallback.disconnect(); + } + if (mFileFetchedCallback.connected()) + { + mFileFetchedCallback.disconnect(); + } } BOOL LLScriptEdCore::postBuild() @@ -424,21 +430,13 @@ BOOL LLScriptEdCore::postBuild() { processKeywords(); } - mRegionChangedCallback = gAgent.addRegionChangedCallback(boost::bind(&LLScriptEdCore::updateKeywords, this)); - - return TRUE; -} - -void LLScriptEdCore::updateKeywords() -{ + if (mLive) { - mEditor->clearSegments(); - } - else - { - processLoaded(); + mRegionChangedCallback = gAgent.addRegionChangedCallback(boost::bind(&LLScriptEdCore::processLoaded, this)); } + + return TRUE; } void LLScriptEdCore::processLoaded() -- cgit v1.2.3