Fixed up LLVolume memory leak caused by mesh repo thread.

Reviewed by Bao.
meow-7.2.2
Leslie Linden 2012-01-31 16:36:25 -08:00
parent de26be1ba2
commit 127f6d1405
1 changed files with 6 additions and 4 deletions

View File

@ -1068,17 +1068,19 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat
bool LLMeshRepoThread::lodReceived(const LLVolumeParams& mesh_params, S32 lod, U8* data, S32 data_size)
{
LLVolume* volume = new LLVolume(mesh_params, LLVolumeLODGroup::getVolumeScaleFromDetail(lod));
LLPointer<LLVolume> volume = new LLVolume(mesh_params, LLVolumeLODGroup::getVolumeScaleFromDetail(lod));
std::string mesh_string((char*) data, data_size);
std::istringstream stream(mesh_string);
if (volume->unpackVolumeFaces(stream, data_size))
{
LoadedMesh mesh(volume, mesh_params, lod);
if (volume->getNumFaces() > 0)
{
LLMutexLock lock(mMutex);
mLoadedQ.push(mesh);
LoadedMesh mesh(volume, mesh_params, lod);
{
LLMutexLock lock(mMutex);
mLoadedQ.push(mesh);
}
return true;
}
}