base/hash/m_hashtable.c
/*! Function to cleanup key/value when removing an entry or destroying the
 *  h. */
Function to cleanup key/value when removing an entry or destroying the
h.
Function to cleanup key / value when removing an entry or destroying the h .
static void M_hashtable_destroy_entry(M_hashtable_t *h, struct M_hashtable_bucket *entry, M_bool destroy_vals)
{
	if (h->flags & M_HASHTABLE_KEYS_ORDERED)
		M_llist_remove_val(h->keys, entry->key, M_LLIST_MATCH_VAL);
	h->key_free(entry->key);
	if (h->flags & M_HASHTABLE_MULTI_VALUE) {
		M_list_destroy(entry->value.multi_value, destroy_vals);
	} else if (destroy_vals) {
		h->value_free(entry->value.value);
	}
}
static void M_hashtable_destroy_entry ( M_hashtable_t * h , struct M_hashtable_bucket * entry , M_bool destroy_vals ) { if ( h -> flags & M_HASHTABLE_KEYS_ORDERED ) M_llist_remove_val ( h -> keys , entry -> key , M_LLIST_MATCH_VAL ) ; h -> key_free ( entry -> key ) ; if ( h -> flags & M_HASHTABLE_MULTI_VALUE ) { M_list_destroy ( entry -> value . multi_value , destroy_vals ) ; } else if ( destroy_vals ) { h -> value_free ( entry -> value . value ) ; } }
Function to cleanup key/value when removing an entry or destroying the
  h.
Function to cleanup key / value when removing an entry or destroying the h .
/* Remove the key from the list of keys. We need to do this before we destroy the key becuase
	 * this is a reference to the key. */