Guardedalloc/C++: delete is valid on a NULL pointer, add a check so MEM_freeN

doesn't print warning messages.
This commit is contained in:
Brecht Van Lommel 2012-06-25 11:43:12 +00:00
parent 2b41b6d669
commit ae797383b7

@ -176,12 +176,14 @@ public: \
return MEM_mallocN(num_bytes, _id); \
} \
void operator delete(void *mem) { \
if (mem) \
MEM_freeN(mem); \
} \
void *operator new[](size_t num_bytes) { \
return MEM_mallocN(num_bytes, _id "[]"); \
} \
void operator delete[](void *mem) { \
if (mem) \
MEM_freeN(mem); \
} \