From 44387d5ff0ef3453204c137b4c3816a689b9f9ce Mon Sep 17 00:00:00 2001 From: prep Date: Wed, 2 May 2012 11:32:11 -0400 Subject: 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. --- indra/newview/pipeline.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra/newview/pipeline.cpp') 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& 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& 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::const_iterator itCurrent = restoreList.begin(); std::vector::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; -- cgit v1.2.3