summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeslie Linden <leslie@lindenlab.com>2012-01-31 16:36:25 -0800
committerLeslie Linden <leslie@lindenlab.com>2012-01-31 16:36:25 -0800
commit127f6d14050bd1d10b3a4b4b8a4c315da43e9f92 (patch)
tree75727af6f49619712687a366498f1b1742159253
parentde26be1ba25a6d3d66dbde50b903bb85d96d9ed4 (diff)
Fixed up LLVolume memory leak caused by mesh repo thread.
Reviewed by Bao.
-rw-r--r--indra/newview/llmeshrepository.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 03dc7f6bba..f2a24bf18a 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -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;
}
}