Added DeleteAndClear method to TDeletingArray.

- Normally, TDeletingArray only deletes its contents when it is destroyed.
  Now you can do it earlier if you want.
This commit is contained in:
Randy Heit 2013-07-25 21:41:18 -05:00
parent f6bbd5abf7
commit e3e32d7cca

View file

@ -371,6 +371,15 @@ public:
delete (*this)[i];
}
}
void DeleteAndClear()
{
for (unsigned int i = 0; i < TArray<T,TT>::Size(); ++i)
{
if ((*this)[i] != NULL)
delete (*this)[i];
}
Clear();
}
};
// TAutoGrowArray -----------------------------------------------------------