MEM_guardedalloc: allow freeing const arrays with MEM_SAFE_FREE
'const' arrays couldn't use this macro with GNUC.
This commit is contained in:
parent
7369a24f61
commit
0fb7d5381e
Notes:
blender-bot
2023-02-14 05:16:25 +01:00
Referenced by issue #77348, Blender LTS: Maintenance Task 2.83
|
@ -204,7 +204,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)
|
||||
|
|
Loading…
Reference in New Issue