Fixed up LLVolume memory leak caused by mesh repo thread.

Tue, 31 Jan 2012 16:36:25 -0800

author
Leslie Linden <leslie@lindenlab.com>
date
Tue, 31 Jan 2012 16:36:25 -0800
changeset 1619
534401934b7a
parent 1618
2c0488ac9fa0
child 1624
693177f51f33

Fixed up LLVolume memory leak caused by mesh repo thread.

Reviewed by Bao.

indra/newview/llmeshrepository.cpp file | annotate | diff | revisions
     1.1 --- a/indra/newview/llmeshrepository.cpp	Sat Jan 28 16:48:34 2012 +0100
     1.2 +++ b/indra/newview/llmeshrepository.cpp	Tue Jan 31 16:36:25 2012 -0800
     1.3 @@ -1066,17 +1066,19 @@
     1.4  
     1.5  bool LLMeshRepoThread::lodReceived(const LLVolumeParams& mesh_params, S32 lod, U8* data, S32 data_size)
     1.6  {
     1.7 -	LLVolume* volume = new LLVolume(mesh_params, LLVolumeLODGroup::getVolumeScaleFromDetail(lod));
     1.8 +	LLPointer<LLVolume> volume = new LLVolume(mesh_params, LLVolumeLODGroup::getVolumeScaleFromDetail(lod));
     1.9  	std::string mesh_string((char*) data, data_size);
    1.10  	std::istringstream stream(mesh_string);
    1.11  
    1.12  	if (volume->unpackVolumeFaces(stream, data_size))
    1.13  	{
    1.14 -		LoadedMesh mesh(volume, mesh_params, lod);
    1.15  		if (volume->getNumFaces() > 0)
    1.16  		{
    1.17 -			LLMutexLock lock(mMutex);
    1.18 -			mLoadedQ.push(mesh);
    1.19 +			LoadedMesh mesh(volume, mesh_params, lod);
    1.20 +			{
    1.21 +				LLMutexLock lock(mMutex);
    1.22 +				mLoadedQ.push(mesh);
    1.23 +			}
    1.24  			return true;
    1.25  		}
    1.26  	}

mercurial