ucx/map.c

changeset 169
08adb4f87160
parent 168
6db9c5d7d7ff
child 255
bf19378aed58
--- a/ucx/map.c	Thu Oct 15 12:46:09 2015 +0200
+++ b/ucx/map.c	Thu Oct 15 15:01:50 2015 +0200
@@ -82,6 +82,14 @@
     alfree(map->allocator, map);
 }
 
+void ucx_map_free_content(UcxMap *map, ucx_destructor destr) {
+    UcxMapIterator iter = ucx_map_iterator(map);
+    void *val;
+    UCX_MAP_FOREACH(key, val, iter) {
+        destr(val);
+    }
+}
+
 void ucx_map_clear(UcxMap *map) {
     if (map->count == 0) {
         return; // nothing to do

mercurial