mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 20:51:58 +00:00
add switch_hashtable_insert_destructor so you can insert a pointer into a hash with a custom destructor and use it in spandsp to fix a leak on reloadxml with the tone_descriptor tables and fix a bunch of random tiny leaks etc
This commit is contained in:
@@ -123,7 +123,8 @@ typedef enum {
|
||||
} hashtable_flag_t;
|
||||
|
||||
SWITCH_DECLARE(int)
|
||||
switch_hashtable_insert(switch_hashtable_t *h, void *k, void *v, hashtable_flag_t flags);
|
||||
switch_hashtable_insert_destructor(switch_hashtable_t *h, void *k, void *v, hashtable_flag_t flags, hashtable_destructor_t destructor);
|
||||
#define switch_hashtable_insert(_h, _k, _v, _f) switch_hashtable_insert_destructor(_h, _k, _v, _f, NULL)
|
||||
|
||||
#define DEFINE_HASHTABLE_INSERT(fnname, keytype, valuetype) \
|
||||
int fnname (switch_hashtable_t *h, keytype *k, valuetype *v) \
|
||||
|
||||
Reference in New Issue
Block a user