From e3e32d7cca2694bc87cc8a9a19202383ebd2126d Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Thu, 25 Jul 2013 21:41:18 -0500 Subject: [PATCH] Added DeleteAndClear method to TDeletingArray. - Normally, TDeletingArray only deletes its contents when it is destroyed. Now you can do it earlier if you want. --- src/tarray.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/tarray.h b/src/tarray.h index 3e66aa748..57de62984 100644 --- a/src/tarray.h +++ b/src/tarray.h @@ -371,6 +371,15 @@ public: delete (*this)[i]; } } + void DeleteAndClear() + { + for (unsigned int i = 0; i < TArray::Size(); ++i) + { + if ((*this)[i] != NULL) + delete (*this)[i]; + } + Clear(); + } }; // TAutoGrowArray -----------------------------------------------------------