Don't leak memory if re-creating an existing array

This commit is contained in:
baldurk
2014-12-07 15:24:48 +00:00
parent 7131d39a6d
commit 9b15527a84
+2
View File
@@ -36,6 +36,7 @@ namespace rdctype
template<typename T>
void create_array(array<T> &ret, size_t count)
{
ret.Delete();
ret.count = (int32_t)count;
if(ret.count == 0)
{
@@ -54,6 +55,7 @@ void create_array(array<T> &ret, size_t count)
template<typename T>
void create_array_uninit(array<T> &ret, size_t count)
{
ret.Delete();
ret.count = (int32_t)count;
if(ret.count == 0)
{