From 4c06f2b600c0141a434626303808db86faf59fa4 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sat, 12 Dec 2009 18:17:15 +0000 Subject: [PATCH] Added boolean deleteIfOwning parameter to MakeEmpty(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34643 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/shared/ObjectList.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/headers/private/shared/ObjectList.h b/headers/private/shared/ObjectList.h index a4655d09cc..bfa1832df7 100644 --- a/headers/private/shared/ObjectList.h +++ b/headers/private/shared/ObjectList.h @@ -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::CountItems() const template void -BObjectList::MakeEmpty() +BObjectList::MakeEmpty(bool deleteIfOwning) { - if (owning) { + if (owning && deleteIfOwning) { int32 count = CountItems(); for (int32 index = 0; index < count; index++) delete ItemAt(index);