diff --git a/inc/hgl/type/Smart.h b/inc/hgl/type/Smart.h index 28c5b39..503d040 100644 --- a/inc/hgl/type/Smart.h +++ b/inc/hgl/type/Smart.h @@ -492,11 +492,8 @@ namespace hgl operator const T *()const{return obj;} const bool operator !()const{return !obj;} - void Clear() + void Discard() { - if(obj) - delete obj; - obj=nullptr; } @@ -549,11 +546,8 @@ namespace hgl T &operator[](int index){return obj[index];} const T &operator[](int index)const{return obj[index];} - void Clear() + void Discard() { - if(!obj)return; - - delete[] obj; obj=nullptr; } };//template class AutoDeleteArray