summaryrefslogtreecommitdiff
path: root/indra/newview/llmeshrepository.cpp
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2016-07-12 21:37:45 +0300
committerandreykproductengine <akleshchev@productengine.com>2016-07-12 21:37:45 +0300
commitb06d5aeec8144f18e039758d3c70e9414f83ce21 (patch)
treee88a24b4302e35d982f121669986e5b25a615bc1 /indra/newview/llmeshrepository.cpp
parent85c0bec92c74e13c08dc316d2d1c3b0941dff536 (diff)
MAINT-6460 Crash calculating mesh complexity
Diffstat (limited to 'indra/newview/llmeshrepository.cpp')
-rw-r--r--indra/newview/llmeshrepository.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 39ebf9f95b..bf7f91d19a 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -3906,8 +3906,8 @@ void LLMeshRepository::buildHull(const LLVolumeParams& params, S32 detail)
bool LLMeshRepository::hasPhysicsShape(const LLUUID& mesh_id)
{
- LLSD mesh = mThread->getMeshHeader(mesh_id);
- if (mesh.has("physics_mesh") && mesh["physics_mesh"].has("size") && (mesh["physics_mesh"]["size"].asInteger() > 0))
+ const LLSD* mesh = mThread->getMeshHeader(mesh_id);
+ if (mesh && mesh->has("physics_mesh") && (*mesh)["physics_mesh"].has("size") && ((*mesh)["physics_mesh"]["size"].asInteger() > 0))
{
return true;
}
@@ -3921,27 +3921,26 @@ bool LLMeshRepository::hasPhysicsShape(const LLUUID& mesh_id)
return false;
}
-LLSD& LLMeshRepository::getMeshHeader(const LLUUID& mesh_id)
+const LLSD* LLMeshRepository::getMeshHeader(const LLUUID& mesh_id)
{
LL_RECORD_BLOCK_TIME(FTM_MESH_FETCH);
return mThread->getMeshHeader(mesh_id);
}
-LLSD& LLMeshRepoThread::getMeshHeader(const LLUUID& mesh_id)
+const LLSD* LLMeshRepoThread::getMeshHeader(const LLUUID& mesh_id)
{
- static LLSD dummy_ret;
if (mesh_id.notNull())
{
LLMutexLock lock(mHeaderMutex);
mesh_header_map::iterator iter = mMeshHeader.find(mesh_id);
if (iter != mMeshHeader.end())
{
- return iter->second;
+ return &(iter->second);
}
}
- return dummy_ret;
+ return NULL;
}