ucx/map.c

changeset 70
6721482eaf8e
parent 69
fb59270b1de3
child 79
cf3757c60c8f
     1.1 --- a/ucx/map.c	Fri Oct 12 10:54:55 2012 +0200
     1.2 +++ b/ucx/map.c	Fri Oct 12 12:00:06 2012 +0200
     1.3 @@ -28,7 +28,7 @@
     1.4      return map;
     1.5  }
     1.6  
     1.7 -void ucx_map_free(UcxMap *map) {
     1.8 +void ucx_map_free_elmlist(UcxMap *map) {
     1.9      for (size_t n = 0 ; n < map->size ; n++) {
    1.10          UcxMapElement *elem = map->map[n];
    1.11          if (elem != NULL) {
    1.12 @@ -41,6 +41,10 @@
    1.13          }
    1.14      }
    1.15      free(map->map);
    1.16 +}
    1.17 +
    1.18 +void ucx_map_free(UcxMap *map) {
    1.19 +    ucx_map_free_elmlist(map);
    1.20      free(map);
    1.21  }
    1.22  
    1.23 @@ -83,7 +87,9 @@
    1.24          }
    1.25          map->count = 0;
    1.26          ucx_map_copy(&oldmap, map, NULL, NULL);
    1.27 -        /* TODO: free the UcxMapElement list of oldmap */
    1.28 +        
    1.29 +        /* free the UcxMapElement list of oldmap */
    1.30 +        ucx_map_free_elmlist(&oldmap);
    1.31      }
    1.32      return 0;
    1.33  }

mercurial