[Bf-blender-cvs] [4107e04c45e] blender-v3.3-release: Fix T102670: Crash after deleting attribute in edit mode

Hans Goudey noreply at git.blender.org
Thu Jan 12 14:07:17 CET 2023


Commit: 4107e04c45e4420177d32224776c6874992c6aa7
Author: Hans Goudey
Date:   Tue Nov 22 13:44:13 2022 -0600
Branches: blender-v3.3-release
https://developer.blender.org/rB4107e04c45e4420177d32224776c6874992c6aa7

Fix T102670: Crash after deleting attribute in edit mode

Since we free BMesh attributes by attempting on every domain,
sometimes the attribute wouldn't be found for a CustomData.
We avoid reallocating custom data blocks in that case, so we
need to pass the ownership of the "pool" back to the BMesh.

===================================================================

M	source/blender/bmesh/intern/bmesh_interp.c

===================================================================

diff --git a/source/blender/bmesh/intern/bmesh_interp.c b/source/blender/bmesh/intern/bmesh_interp.c
index 0c3db31dd1f..cf780cb72d0 100644
--- a/source/blender/bmesh/intern/bmesh_interp.c
+++ b/source/blender/bmesh/intern/bmesh_interp.c
@@ -907,6 +907,10 @@ bool BM_data_layer_free_named(BMesh *bm, CustomData *data, const char *name)
   if (has_layer) {
     update_data_blocks(bm, &olddata, data);
   }
+  else {
+    /* Move pool ownership back to BMesh CustomData, no block reallocation. */
+    data->pool = olddata.pool;
+  }
 
   if (olddata.layers) {
     MEM_freeN(olddata.layers);



More information about the Bf-blender-cvs mailing list