From 9db4d58b378d0811a836fee50292ab4a34a19297 Mon Sep 17 00:00:00 2001 From: "Leandro A. F. Pereira" Date: Wed, 29 Apr 2009 23:07:04 -0300 Subject: When unloading modules, clear all tree stores --- hardinfo2/util.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'hardinfo2/util.c') diff --git a/hardinfo2/util.c b/hardinfo2/util.c index 27e44943..a8bb8b8c 100644 --- a/hardinfo2/util.c +++ b/hardinfo2/util.c @@ -599,7 +599,10 @@ static void module_unload(ShellModule * module) gdk_pixbuf_unref(module->icon); for (entry = module->entries; entry; entry = entry->next) { - g_free(entry->data); + ShellModuleEntry *e = (ShellModuleEntry *)entry->data; + + g_source_remove_by_user_data(e); + g_free(e); } g_slist_free(module->entries); @@ -626,10 +629,19 @@ void module_unload_all(void) gtk_tree_store_clear(GTK_TREE_STORE(shell->tree->model)); sync_manager_clear_entries(); + /* TODO FIXME clear shell::update_tbl */ + + gtk_tree_store_clear(GTK_TREE_STORE(shell->tree->model)); + gtk_tree_store_clear(GTK_TREE_STORE(shell->info->model)); + gtk_tree_store_clear(GTK_TREE_STORE(shell->moreinfo->model)); + + gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(shell->info->view), FALSE); + g_slist_free(shell->tree->modules); g_slist_free(shell->merge_ids); shell->merge_ids = NULL; shell->tree->modules = NULL; + shell->selected = NULL; } static ShellModule *module_load(gchar * filename) -- cgit v1.2.3