diff --git a/intern/guardedalloc/MEM_guardedalloc.h b/intern/guardedalloc/MEM_guardedalloc.h index bb4c372e46d..1d0a8db6329 100644 --- a/intern/guardedalloc/MEM_guardedalloc.h +++ b/intern/guardedalloc/MEM_guardedalloc.h @@ -176,13 +176,15 @@ public: \ return MEM_mallocN(num_bytes, _id); \ } \ void operator delete(void *mem) { \ - MEM_freeN(mem); \ + if (mem) \ + MEM_freeN(mem); \ } \ void *operator new[](size_t num_bytes) { \ return MEM_mallocN(num_bytes, _id "[]"); \ } \ void operator delete[](void *mem) { \ - MEM_freeN(mem); \ + if (mem) \ + MEM_freeN(mem); \ } \ #endif