diff --git a/inc/hgl/type/Smart.h b/inc/hgl/type/Smart.h index e0d0ac9..d620438 100644 --- a/inc/hgl/type/Smart.h +++ b/inc/hgl/type/Smart.h @@ -518,6 +518,11 @@ namespace hgl obj=nullptr; } + AutoDeleteArray(const size_t count) + { + obj=new T[count]; + } + AutoDeleteArray(T *o) { obj=o; diff --git a/src/FileSystem/FileSystem.cpp b/src/FileSystem/FileSystem.cpp index 23b871e..e3fd8d4 100644 --- a/src/FileSystem/FileSystem.cpp +++ b/src/FileSystem/FileSystem.cpp @@ -33,8 +33,8 @@ namespace hgl return(false); int64 pos=0,size; - AutoDeleteArray data1=new char[buf_size]; - AutoDeleteArray data2=new char[buf_size]; + AutoDeleteArray data1(buf_size); + AutoDeleteArray data2(buf_size); while(pos