From: Michael Schroeder Date: Mon, 25 Aug 2008 13:12:59 +0000 (+0000) Subject: - add stringpool_free() X-Git-Tag: BASE-SuSE-Code-12_1-Branch~308^2~242 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a40f13f1eedba2d13b43165e83caeab672ab0f92;p=thirdparty%2Flibsolv.git - add stringpool_free() --- diff --git a/src/pool.c b/src/pool.c index d14c27fb..db9ec8dc 100644 --- a/src/pool.c +++ b/src/pool.c @@ -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++) diff --git a/src/strpool.c b/src/strpool.c index 79e450b4..2956a757 100644 --- a/src/strpool.c +++ b/src/strpool.c @@ -38,6 +38,14 @@ stringpool_init(Stringpool *ss, const char *strs[]) ss->nstrings = count; } +void +stringpool_free(Stringpool *ss) +{ + sat_free(ss->strings); + sat_free(ss->stringspace); + sat_free(ss->stringhashtbl); +} + void stringpool_init_empty(Stringpool *ss) { diff --git a/src/strpool.h b/src/strpool.h index dcab2ae9..59e269fc 100644 --- a/src/strpool.h +++ b/src/strpool.h @@ -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);