diff options
| -rwxr-xr-x | indra/newview/llpreviewscript.cpp | 26 | ||||
| -rwxr-xr-x | indra/newview/llpreviewscript.h | 1 | 
2 files changed, 12 insertions, 15 deletions
| 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() diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index e19a87ec0a..5aab3ed938 100755 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -81,7 +81,6 @@ public:  	void			initMenu();  	void			processKeywords();  	void			processLoaded(); -	void			updateKeywords();  	virtual void	draw();  	/*virtual*/	BOOL	postBuild(); | 
