- add stringpool_free()
authorMichael Schroeder <mls@suse.de>
Mon, 25 Aug 2008 13:12:59 +0000 (13:12 +0000)
committerMichael Schroeder <mls@suse.de>
Mon, 25 Aug 2008 13:12:59 +0000 (13:12 +0000)
src/pool.c
src/strpool.c
src/strpool.h

index d14c27f..db9ec8d 100644 (file)
@@ -76,8 +76,7 @@ pool_free(Pool *pool)
   repo_freeallrepos(pool, 1);
   sat_free(pool->id2arch);
   sat_free(pool->solvables);
-  sat_free(pool->ss.stringspace);
-  sat_free(pool->ss.strings);
+  stringpool_free(&pool->ss);
   sat_free(pool->rels);
   queue_free(&pool->vendormap);
   for (i = 0; i < POOL_TMPSPACEBUF; i++)
index 79e450b..2956a75 100644 (file)
@@ -39,6 +39,14 @@ stringpool_init(Stringpool *ss, const char *strs[])
 }
 
 void
+stringpool_free(Stringpool *ss)
+{
+  sat_free(ss->strings);
+  sat_free(ss->stringspace);
+  sat_free(ss->stringhashtbl);
+}
+
+void
 stringpool_init_empty(Stringpool *ss)
 {
   const char *emptystrs[] = {
index dcab2ae..59e269f 100644 (file)
@@ -27,6 +27,7 @@ struct _Stringpool
 void stringpool_init(Stringpool *ss, const char *strs[]);
 void stringpool_init_empty(Stringpool *ss);
 void stringpool_clone(Stringpool *ss, Stringpool *from);
+void stringpool_free(Stringpool *ss);
 
 Id stringpool_str2id (Stringpool *ss, const char *str, int create);
 Id stringpool_strn2id (Stringpool *ss, const char *str, unsigned int len, int create);