davep avatar davep committed 2c4d4da

MAINT-646 Fix for leak introduced by optimizations.

Comments (0)

Files changed (3)

indra/newview/llviewerobjectlist.cpp

 		{
 			mActiveObjects[idx] = mActiveObjects[last_index];
 			mActiveObjects[idx]->setListIndex(idx);
-			mActiveObjects.pop_back();
 		}
+
+		mActiveObjects.pop_back();
 	}
 }
 
 			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)

indra/newview/llviewerobjectlist.h

 	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);

indra/newview/llviewerwindow.cpp

 			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;
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.