Added boolean deleteIfOwning parameter to MakeEmpty().

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34643 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2009-12-12 18:17:15 +00:00
parent b1b74111f5
commit 4c06f2b600
1 changed files with 3 additions and 3 deletions

View File

@ -159,7 +159,7 @@ public:
T *RemoveItemAt(int32);
// returns the removed item
void MakeEmpty();
void MakeEmpty(bool deleteIfOwning = true);
// item access
T *ItemAt(int32) const;
@ -561,9 +561,9 @@ BObjectList<T>::CountItems() const
template<class T>
void
BObjectList<T>::MakeEmpty()
BObjectList<T>::MakeEmpty(bool deleteIfOwning)
{
if (owning) {
if (owning && deleteIfOwning) {
int32 count = CountItems();
for (int32 index = 0; index < count; index++)
delete ItemAt(index);