diff --git a/intern/guardedalloc/MEM_guardedalloc.h b/intern/guardedalloc/MEM_guardedalloc.h index 958e5ae86cd..2a4ae5355a0 100644 --- a/intern/guardedalloc/MEM_guardedalloc.h +++ b/intern/guardedalloc/MEM_guardedalloc.h @@ -278,6 +278,15 @@ template inline void OBJECT_GUARDED_DESTRUCTOR(T *what) } \ } \ (void)0 +# define OBJECT_GUARDED_SAFE_DELETE(what, type) \ + { \ + if (what) { \ + OBJECT_GUARDED_DESTRUCTOR((type *)what); \ + MEM_freeN(what); \ + what = NULL; \ + } \ + } \ + (void)0 #endif /* __cplusplus */ #endif /* __MEM_GUARDEDALLOC_H__ */