hash-func: add destructors for key and value

If they are set, then they are called in hashmap_clear() or
hashmap_free().
This commit is contained in:
Yu Watanabe
2018-12-02 11:59:07 +01:00
parent 7a08d314f2
commit 59a5cda7b9
5 changed files with 113 additions and 90 deletions
+2 -4
View File
@@ -21,13 +21,11 @@ static inline int ordered_set_ensure_allocated(OrderedSet **s, const struct hash
}
static inline OrderedSet* ordered_set_free(OrderedSet *s) {
ordered_hashmap_free((OrderedHashmap*) s);
return NULL;
return (OrderedSet*) ordered_hashmap_free((OrderedHashmap*) s);
}
static inline OrderedSet* ordered_set_free_free(OrderedSet *s) {
ordered_hashmap_free_free((OrderedHashmap*) s);
return NULL;
return (OrderedSet*) ordered_hashmap_free_free((OrderedHashmap*) s);
}
static inline int ordered_set_put(OrderedSet *s, void *p) {