diff options
Diffstat (limited to 'source/blender/blenlib/intern/scanfill_utils.c')
-rw-r--r-- | source/blender/blenlib/intern/scanfill_utils.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/blenlib/intern/scanfill_utils.c b/source/blender/blenlib/intern/scanfill_utils.c index a606ac41aa1..d0420a30448 100644 --- a/source/blender/blenlib/intern/scanfill_utils.c +++ b/source/blender/blenlib/intern/scanfill_utils.c @@ -112,11 +112,13 @@ void BLI_scanfill_view3d_dump(ScanFillContext *sf_ctx) static ListBase *edge_isect_ls_ensure(GHash *isect_hash, ScanFillEdge *eed) { ListBase *e_ls; - e_ls = BLI_ghash_lookup(isect_hash, eed); - if (e_ls == NULL) { - e_ls = MEM_callocN(sizeof(ListBase), __func__); - BLI_ghash_insert(isect_hash, eed, e_ls); + void **val_p; + + if (!BLI_ghash_ensure_p(isect_hash, eed, &val_p)) { + *val_p = MEM_callocN(sizeof(ListBase), __func__); } + e_ls = *val_p; + return e_ls; } |