When freeing the preferences of a module, also free the preferences of its

submodule.

svn path=/trunk/; revision=51328
This commit is contained in:
Evan Huus 2013-08-13 02:56:55 +00:00
parent f528d4ecbc
commit 14b098baf7
1 changed files with 7 additions and 2 deletions

View File

@ -258,10 +258,15 @@ free_pref(gpointer data, gpointer user_data _U_)
static guint
free_module_prefs(module_t *module, gpointer data _U_)
{
g_list_foreach(module->prefs, free_pref, NULL);
g_list_free(module->prefs);
if (module->prefs) {
g_list_foreach(module->prefs, free_pref, NULL);
g_list_free(module->prefs);
}
module->prefs = NULL;
module->numprefs = 0;
if (module->submodules) {
prefs_modules_foreach_submodules(module, free_module_prefs, NULL);
}
/* We don't free the actual module: its submodules pointer points to
a wmem_tree and the module itself is stored in a wmem_tree
*/