summaryrefslogtreecommitdiff
path: root/src/core/modules.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-08-26 15:39:44 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-08-26 15:39:44 +0000
commite395e87dedd9aa85f05e5c74330a76f1ef700371 (patch)
tree1184487b13038499f1771e4c553222f85b8524d2 /src/core/modules.c
parent3d124da13b8da5c0b535abfe6265fc471d9d2ebd (diff)
downloadirssi-e395e87dedd9aa85f05e5c74330a76f1ef700371.zip
Lots of moving stuff around - hopefully I didn't break too much :)
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@632 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core/modules.c')
-rw-r--r--src/core/modules.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/core/modules.c b/src/core/modules.c
index 1749c6fb..fc10487d 100644
--- a/src/core/modules.c
+++ b/src/core/modules.c
@@ -324,6 +324,11 @@ void module_unload(MODULE_REC *module)
g_free(module);
}
+static void uniq_get_modules(char *key, void *value, GSList **list)
+{
+ *list = g_slist_append(*list, key);
+}
+
void modules_init(void)
{
modules = NULL;
@@ -342,11 +347,19 @@ void modules_init(void)
void modules_deinit(void)
{
- g_hash_table_foreach(idlookup, (GHFunc) module_uniq_destroy, NULL);
- g_hash_table_destroy(idlookup);
- g_hash_table_destroy(uniqids);
+ GSList *list;
- g_hash_table_foreach(stridlookup, (GHFunc) module_uniq_destroy, NULL);
+ list = NULL;
+ g_hash_table_foreach(idlookup, (GHFunc) uniq_get_modules, &list);
+ g_hash_table_foreach(stridlookup, (GHFunc) uniq_get_modules, &list);
+
+ while (list != NULL) {
+ module_uniq_destroy(list->data);
+ list = g_slist_remove(list, list->data);
+ }
+
+ g_hash_table_destroy(idlookup);
g_hash_table_destroy(stridlookup);
+ g_hash_table_destroy(uniqids);
g_hash_table_destroy(uniqstrids);
}