diff options
| author | prep <prep@lindenlab.com> | 2012-05-02 11:32:11 -0400 | 
|---|---|---|
| committer | prep <prep@lindenlab.com> | 2012-05-02 11:32:11 -0400 | 
| commit | 44387d5ff0ef3453204c137b4c3816a689b9f9ce (patch) | |
| tree | a99fb9829719ea8e27cb6756c33f52acef4e1d8c /indra | |
| parent | 9eec646601d6ce903d41dc305364373dc0a18b74 (diff) | |
Fix for Path-494. Teleporting with a list of renderables that needed to be restored caused a crash because the vo's had already been removed prior to the  restorePermanentObjects() call.
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llfloaterpathfindingconsole.cpp | 10 | ||||
| -rw-r--r-- | indra/newview/llfloaterpathfindingconsole.h | 3 | ||||
| -rw-r--r-- | indra/newview/pipeline.cpp | 10 | 
3 files changed, 19 insertions, 4 deletions
| diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index 570a3f45eb..9f7e4ab838 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -611,8 +611,7 @@ void LLFloaterPathfindingConsole::onRenderWorldMovablesOnly()  	}  	else  	{ -		gPipeline.restorePermanentObjects( mRenderableRestoreList ); -		mRenderableRestoreList.clear(); +		cleanupRenderableRestoreItems();  	}  }  void LLFloaterPathfindingConsole::onNavMeshZoneCB(LLPathfindingNavMeshZone::ENavMeshZoneRequestStatus pNavMeshZoneRequestStatus) @@ -993,6 +992,13 @@ void LLFloaterPathfindingConsole::initializeNavMeshZoneForCurrentRegion()  	mNavMeshZone.initialize();  	mNavMeshZone.enable();  	mNavMeshZone.refresh(); +	mRenderableRestoreList.clear();	 +} + +void LLFloaterPathfindingConsole::cleanupRenderableRestoreItems() +{ +	gPipeline.restorePermanentObjects( mRenderableRestoreList ); +	mRenderableRestoreList.clear();  }  void LLFloaterPathfindingConsole::setAgentState(LLPathfindingManager::EAgentState pAgentState) diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h index 4af81698ff..348deeed00 100644 --- a/indra/newview/llfloaterpathfindingconsole.h +++ b/indra/newview/llfloaterpathfindingconsole.h @@ -158,6 +158,7 @@ private:  	void handleRetrieveNeighborChange(LLControlVariable *pControl, const LLSD &pNewValue);  	void handleNavMeshColorChange(LLControlVariable *pControl, const LLSD &pNewValue);  	void fillInColorsForNavMeshVisualization(); +	void cleanupRenderableRestoreItems();  	LLRootHandle<LLFloaterPathfindingConsole>     mSelfHandle;  	LLTextBase                                    *mShowLabel; @@ -222,7 +223,7 @@ private:  	EConsoleState                                 mConsoleState; -	std::vector<U32>								  mRenderableRestoreList; +	std::vector<U32>							  mRenderableRestoreList;  	static LLHandle<LLFloaterPathfindingConsole>  sInstanceHandle;  }; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 7299f73add..fb55d954fc 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -10109,6 +10109,7 @@ void LLPipeline::hidePermanentObjects( std::vector<U32>& restoreList )  {  	//This method is used to hide any vo's from the object list that may have  	//the permanent flag set. +	  	U32 objCnt = gObjectList.getNumObjects();  	for (U32 i = 0; i < objCnt; ++i)  	{ @@ -10144,13 +10145,20 @@ void LLPipeline::restorePermanentObjects( const std::vector<U32>& restoreList )  {  	//This method is used to restore(unhide) any vo's from the object list that may have  	//been hidden because their permanency flag was set. +  	std::vector<U32>::const_iterator itCurrent	= restoreList.begin();  	std::vector<U32>::const_iterator itEnd		= restoreList.end(); +	 +	U32 objCnt = gObjectList.getNumObjects();  	while ( itCurrent != itEnd )  	{  		U32 index = *itCurrent; -		LLViewerObject* pObject = gObjectList.getObject( index ); +		LLViewerObject* pObject = NULL; +		if ( index < objCnt )  +		{ +			pObject = gObjectList.getObject( index ); +		}  		if ( pObject )  		{  			LLDrawable *pDrawable = pObject->mDrawable; | 
