fix for BLI_ghash_clear from Sv. Lockal (lockal)
This commit is contained in:
@@ -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);
|
||||
|
||||
/* *** */
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user