summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2012-10-31 16:00:56 -0500
committerDave Parks <davep@lindenlab.com>2012-10-31 16:00:56 -0500
commit44a024d2f5d4467372d0d2082a83449696b22948 (patch)
tree665bb7bb4b4c7f147e0e76389d56488c9fc222b5 /indra
parentb8e14ad2b250ae8c4cae877035e38c485a841515 (diff)
MAINT-646 Fix for leak introduced by optimizations.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llviewerobjectlist.cpp9
-rw-r--r--indra/newview/llviewerobjectlist.h1
-rw-r--r--indra/newview/llviewerwindow.cpp3
3 files changed, 12 insertions, 1 deletions
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index ea20950b36..b433484783 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -1405,8 +1405,9 @@ void LLViewerObjectList::removeFromActiveList(LLViewerObject* objectp)
{
mActiveObjects[idx] = mActiveObjects[last_index];
mActiveObjects[idx]->setListIndex(idx);
- mActiveObjects.pop_back();
}
+
+ mActiveObjects.pop_back();
}
}
@@ -1450,6 +1451,12 @@ void LLViewerObjectList::updateActive(LLViewerObject *objectp)
objectp->setOnActiveList(FALSE);
}
}
+
+ //post condition: if object is active, it must be on the active list
+ llassert(!active || std::find(mActiveObjects.begin(), mActiveObjects.end(), objectp) != mActiveObjects.end());
+
+ //post condition: if object is not active, it must not be on the active list
+ llassert(active || std::find(mActiveObjects.begin(), mActiveObjects.end(), objectp) == mActiveObjects.end());
}
void LLViewerObjectList::updateObjectCost(LLViewerObject* object)
diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h
index 9936432a71..449a4633ff 100644
--- a/indra/newview/llviewerobjectlist.h
+++ b/indra/newview/llviewerobjectlist.h
@@ -129,6 +129,7 @@ public:
LLViewerObject *getSelectedObject(const U32 object_id);
inline S32 getNumObjects() { return (S32) mObjects.size(); }
+ inline S32 getNumActiveObjects() { return (S32) mActiveObjects.size(); }
void addToMap(LLViewerObject *objectp);
void removeFromMap(LLViewerObject *objectp);
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index af2eec9ba8..98ea923272 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -563,6 +563,9 @@ public:
addText(xpos, ypos, llformat("%d Render Calls", gPipeline.mBatchCount));
ypos += y_inc;
+ addText(xpos, ypos, llformat("%d/%d Objects Active", gObjectList.getNumActiveObjects(), gObjectList.getNumObjects()));
+ ypos += y_inc;
+
addText(xpos, ypos, llformat("%d Matrix Ops", gPipeline.mMatrixOpCount));
ypos += y_inc;