From 7ef0c37befab62cc11ceb00d1d9f7fe3be258517 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Sun, 7 Jul 2024 19:08:13 +0200 Subject: [PATCH] Fix MEM_new/MEM_freeN mistach Calling `MEM_freeN` on data allocated with `MEM_new` is bad, since it will not call a destructor matching the one invoked as part of `MEM_new`. Would crash with the guarded allocator, which detects such mismatches now. --- source/blender/editors/interface/interface.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/interface/interface.cc b/source/blender/editors/interface/interface.cc index e217aeafe63..4b6ed43e134 100644 --- a/source/blender/editors/interface/interface.cc +++ b/source/blender/editors/interface/interface.cc @@ -5627,7 +5627,7 @@ void UI_but_operator_set(uiBut *but, MEM_SAFE_FREE(but->opptr); if (op_props) { - but->opptr = MEM_new(__func__, *op_props); + but->opptr = MEM_cnew(__func__, *op_props); } }