diff options
author | Evan Huus <eapache@gmail.com> | 2013-08-13 02:56:55 +0000 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2013-08-13 02:56:55 +0000 |
commit | 14b098baf7ac4ba8382b4038fd717b5e186c03b8 (patch) | |
tree | 5138c947f877149c3cf1ac6463720969fdf417c8 /epan/prefs.c | |
parent | f528d4ecbc5a6ff6052974bc49c19b4064cf7b9b (diff) |
When freeing the preferences of a module, also free the preferences of its
submodule.
svn path=/trunk/; revision=51328
Diffstat (limited to 'epan/prefs.c')
-rw-r--r-- | epan/prefs.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/epan/prefs.c b/epan/prefs.c index 6667f25752..8aa329e80e 100644 --- a/epan/prefs.c +++ b/epan/prefs.c @@ -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 */ |