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.
This commit is contained in:
Hans Goudey
2022-11-22 13:44:13 -06:00
parent fa8a59689b
commit 461cb550cc

View File

@@ -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);