diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-08-01 00:50:55 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-08-01 00:50:55 +0400 |
commit | 22dae3e6005d4360212c53e799a50c528ecf3cee (patch) | |
tree | 0ed8e3b3415babcf3ffdb66d7b0519f5573900ba /source | |
parent | 3840e0b2347200ceb414f12deb3436b20d274c66 (diff) |
fix for BLI_ghash_clear from Sv. Lockal (lockal)
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/BLI_ghash.h | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/BLI_ghash.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/blenlib/BLI_ghash.h b/source/blender/blenlib/BLI_ghash.h index 930715b4bc6..3ad0e18c8d7 100644 --- a/source/blender/blenlib/BLI_ghash.h +++ b/source/blender/blenlib/BLI_ghash.h @@ -73,7 +73,7 @@ void *BLI_ghash_lookup(GHash *gh, const void *key); bool BLI_ghash_remove(GHash *gh, void *key, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp); void BLI_ghash_clear(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp); void *BLI_ghash_pop(GHash *gh, void *key, GHashKeyFreeFP keyfreefp); -bool BLI_ghash_haskey(GHash *gh, const void *key); +bool BLI_ghash_haskey(GHash *gh, const void *key); int BLI_ghash_size(GHash *gh); /* *** */ diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c index 10b3c01d274..14dfbcffebe 100644 --- a/source/blender/blenlib/intern/BLI_ghash.c +++ b/source/blender/blenlib/intern/BLI_ghash.c @@ -179,7 +179,8 @@ void BLI_ghash_clear(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfree gh->nentries = 0; gh->nbuckets = hashsizes[gh->cursize]; - gh->buckets = MEM_recallocN(gh->buckets, gh->nbuckets * sizeof(*gh->buckets)); + MEM_freeN(gh->buckets); + gh->buckets = MEM_callocN(gh->nbuckets * sizeof(*gh->buckets), "buckets"); } /* same as above but return the value, |