MEM_guardedalloc: allow freeing const arrays with MEM_SAFE_FREE

'const' arrays couldn't use this macro with GNUC.
This commit is contained in:
Campbell Barton
2020-06-24 22:08:49 +10:00
parent 9b3dfbe651
commit 074929d1c5

View File

@@ -187,7 +187,8 @@ extern size_t (*MEM_get_peak_memory)(void) ATTR_WARN_UNUSED_RESULT;
do { \
typeof(&(v)) _v = &(v); \
if (*_v) { \
MEM_freeN(*_v); \
/* Cast so we can free constant arrays. */ \
MEM_freeN((void *)*_v); \
*_v = NULL; \
} \
} while (0)