fix [#30220] Knife Tool Leaks memory

both crash and leak are fixed now.
This commit is contained in:
Campbell Barton
2012-02-17 05:33:23 +00:00
parent 8a2bf0ba54
commit 02987fd5e1
2 changed files with 3 additions and 1 deletions

View File

@@ -88,7 +88,7 @@ void BLI_smallhash_insert(SmallHash *hash, uintptr_t key, void *item)
int i = 0;
if (hash->table != hash->stacktable || newsize > SMSTACKSIZE) {
tmp = MEM_callocN(sizeof(*hash->table) * newsize, "new hashkeys");
tmp = MEM_callocN(sizeof(*hash->table) * newsize, __func__);
}
else {
SWAP(SmallHashEntry *, hash->stacktable, hash->copytable);

View File

@@ -1680,6 +1680,8 @@ static void remerge_faces(knifetool_opdata *kcd)
/* bm->elem_index_dirty &= ~BM_FACE; */
bm->elem_index_dirty |= BM_FACE;
BLI_smallhash_release(visit);
BLI_array_free(stack);
BLI_array_free(faces);
}