Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-06-25 15:43:12 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-06-25 15:43:12 +0400
commitae797383b76a4489139b0152a6084b5dd4de2ba3 (patch)
tree39e6132ca8c0d0ac604936880712cbe845bfc7b4 /intern/guardedalloc
parent2b41b6d669fa6fc62b20785adba9fb60f000e63e (diff)
Guardedalloc/C++: delete is valid on a NULL pointer, add a check so MEM_freeN
doesn't print warning messages.
Diffstat (limited to 'intern/guardedalloc')
-rw-r--r--intern/guardedalloc/MEM_guardedalloc.h6
1 files changed, 4 insertions, 2 deletions
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