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