[Bf-blender-cvs] [daf03b6f566] sculpt-dev: Sculpt-dev: fix another freelist id bug
Joseph Eagar
noreply at git.blender.org
Sun Nov 14 10:28:44 CET 2021
Commit: daf03b6f5666e7609aa07aedf1f2fa973d9907f3
Author: Joseph Eagar
Date: Sun Nov 14 01:28:18 2021 -0800
Branches: sculpt-dev
https://developer.blender.org/rBdaf03b6f5666e7609aa07aedf1f2fa973d9907f3
Sculpt-dev: fix another freelist id bug
===================================================================
M source/blender/bmesh/intern/bmesh_construct.c
===================================================================
diff --git a/source/blender/bmesh/intern/bmesh_construct.c b/source/blender/bmesh/intern/bmesh_construct.c
index 4c303da39d2..a30de561722 100644
--- a/source/blender/bmesh/intern/bmesh_construct.c
+++ b/source/blender/bmesh/intern/bmesh_construct.c
@@ -119,9 +119,14 @@ void bm_id_freelist_take(BMesh *bm, uint id)
void **val = BLI_ghash_lookup_p(bm->idmap.free_idx_map, POINTER_FROM_UINT(id));
if (val) {
- int i = POINTER_AS_INT(*val);
+ uint i = POINTER_AS_UINT(*val);
+
+ uint end = bm->idmap.freelist[bm->idmap.freelist_len - 1];
// swap with end
+ void **endval = BLI_ghash_lookup_p(bm->idmap.free_idx_map, POINTER_FROM_UINT(end));
+ *endval = POINTER_FROM_UINT(i);
+
bm->idmap.freelist[i] = bm->idmap.freelist[bm->idmap.freelist_len - 1];
bm->idmap.freelist_len--;
}
More information about the Bf-blender-cvs
mailing list