]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Merging FS-3432 switch_core_hash.c patch in from Tamas
authordschreiber <d@d-man.org>
Wed, 20 Jun 2012 13:43:36 +0000 (06:43 -0700)
committerdschreiber <d@d-man.org>
Thu, 21 Jun 2012 21:09:49 +0000 (14:09 -0700)
src/switch_core_hash.c

index 4ac3d2620eed7cbbb206e89e2cf39caa15197601..c31a31fa9cd07f020fd08b9e109937bdec101f87 100644 (file)
@@ -157,7 +157,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_delete_multi(switch_hash_t *has
        switch_event_create_subclass(&event, SWITCH_EVENT_CLONE, NULL);
        switch_assert(event);
        
-       /* iterate through the hash, call callback, if callback returns true, put the key on the list (event)
+       /* iterate through the hash, call callback, if callback returns NULL or true, put the key on the list (event)
           When done, iterate through the list deleting hash entries
         */
        
@@ -165,7 +165,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_delete_multi(switch_hash_t *has
                const void *key;
                void *val;
                switch_hash_this(hi, &key, NULL, &val);
-               if (callback(key, val, pData)) {
+               if (!callback || callback(key, val, pData)) {
                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "delete", (const char *) key);
                }
        }