aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmath
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llmath/llvolumemgr.cpp28
-rw-r--r--linden/indra/llmath/llvolumemgr.h1
2 files changed, 25 insertions, 4 deletions
diff --git a/linden/indra/llmath/llvolumemgr.cpp b/linden/indra/llmath/llvolumemgr.cpp
index 0b49bb3..0b5464c 100644
--- a/linden/indra/llmath/llvolumemgr.cpp
+++ b/linden/indra/llmath/llvolumemgr.cpp
@@ -77,11 +77,8 @@ BOOL LLVolumeMgr::cleanup()
77 iter != end; iter++) 77 iter != end; iter++)
78 { 78 {
79 LLVolumeLODGroup *volgroupp = iter->second; 79 LLVolumeLODGroup *volgroupp = iter->second;
80 if (volgroupp->getNumRefs() != 0) 80 if (volgroupp->cleanupRefs() == false)
81 { 81 {
82 llwarns << "Volume group " << volgroupp << " has "
83 << volgroupp->getNumRefs() << " remaining refs" << llendl;
84 llwarns << *volgroupp->getVolumeParams() << llendl;
85 no_refs = FALSE; 82 no_refs = FALSE;
86 } 83 }
87 delete volgroupp; 84 delete volgroupp;
@@ -274,6 +271,29 @@ LLVolumeLODGroup::~LLVolumeLODGroup()
274 } 271 }
275} 272}
276 273
274// Called from LLVolumeMgr::cleanup
275bool LLVolumeLODGroup::cleanupRefs()
276{
277 bool res = true;
278 if (mRefs != 0)
279 {
280 llwarns << "Volume group has remaining refs:" << getNumRefs() << llendl;
281 mRefs = 0;
282 for (S32 i = 0; i < NUM_LODS; i++)
283 {
284 if (mLODRefs[i] > 0)
285 {
286 llwarns << " LOD " << i << " refs = " << mLODRefs[i] << llendl;
287 mLODRefs[i] = 0;
288 mVolumeLODs[i] = NULL;
289 }
290 }
291 llwarns << *getVolumeParams() << llendl;
292 res = false;
293 }
294 return res;
295}
296
277LLVolume* LLVolumeLODGroup::getLODVolume(const S32 detail) 297LLVolume* LLVolumeLODGroup::getLODVolume(const S32 detail)
278{ 298{
279 llassert(detail >=0 && detail < NUM_LODS); 299 llassert(detail >=0 && detail < NUM_LODS);
diff --git a/linden/indra/llmath/llvolumemgr.h b/linden/indra/llmath/llvolumemgr.h
index 8f107f6..dcaca01 100644
--- a/linden/indra/llmath/llvolumemgr.h
+++ b/linden/indra/llmath/llvolumemgr.h
@@ -53,6 +53,7 @@ public:
53 53
54 LLVolumeLODGroup(const LLVolumeParams &params); 54 LLVolumeLODGroup(const LLVolumeParams &params);
55 ~LLVolumeLODGroup(); 55 ~LLVolumeLODGroup();
56 bool cleanupRefs();
56 57
57 static S32 getDetailFromTan(const F32 tan_angle); 58 static S32 getDetailFromTan(const F32 tan_angle);
58 static void getDetailProximity(const F32 tan_angle, F32 &to_lower, F32& to_higher); 59 static void getDetailProximity(const F32 tan_angle, F32 &to_lower, F32& to_higher);