From 3c91317a2b382ecd62b6581eb5e0c2476f29ced3 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 29 Dec 2010 13:07:13 -0500 Subject: SH-652 Viewer crash when right-clicking an avatar while in edit mode Null pointer issue. --- indra/newview/llvovolume.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index fa0f48fce6..3219f662df 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2905,12 +2905,21 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const { // base cost of each prim should be 10 points static const U32 ARC_PRIM_COST = 10; - - // get access to params we'll need at various points - LLVolumeParams volume_params = getVolume()->getParams(); - LLPathParams path_params = volume_params.getPathParams(); - LLProfileParams profile_params = volume_params.getProfileParams(); + // Get access to params we'll need at various points. + // Skip if this is object doesn't have a volume (e.g. is an avatar). + const BOOL has_volume = (getVolume() != NULL); + LLVolumeParams volume_params; + LLPathParams path_params; + LLProfileParams profile_params; + + if (has_volume) + { + volume_params = getVolume()->getParams(); + path_params = volume_params.getPathParams(); + profile_params = volume_params.getProfileParams(); + } + // per-prim costs static const U32 ARC_INVISI_COST = 1; static const U32 ARC_PARTICLE_COST = 100; -- cgit v1.2.3 From ca9df698db9c7a118d29adfe52f49054c333d982 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Thu, 30 Dec 2010 22:08:25 -0800 Subject: Code review fix from davep - use booling or operator and not binary one Remove unnecessary state check. Initial dialog work for showing physics cost in upload dialog --- indra/newview/llvovolume.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 3219f662df..471df30bfe 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4384,12 +4384,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) LLFastTimer t(FTM_VOLUME_GEOM_PARTIAL); LLDrawable* drawablep = *drawable_iter; - if (drawablep->isDead() || drawablep->isState(LLDrawable::FORCE_INVISIBLE) ) - { - continue; - } - - if (drawablep->isState(LLDrawable::REBUILD_ALL)) + if (!drawablep->isDead() && drawablep->isState(LLDrawable::REBUILD_ALL) ) { LLVOVolume* vobj = drawablep->getVOVolume(); vobj->preRebuild(); -- cgit v1.2.3