diff options
author | Dario Lombardo <lomato@gmail.com> | 2017-01-16 22:41:53 +0100 |
---|---|---|
committer | Dario Lombardo <lomato@gmail.com> | 2017-01-18 08:25:33 +0000 |
commit | fe89424160a3ebf52a02b2b68ee3ff4ab3426431 (patch) | |
tree | fd8ccabc9288f3f7b78496fff382c4012116a4c6 | |
parent | ae03fc73539e0ca65edaea0e37a724ff8169de9f (diff) | |
download | wireshark-fe89424160a3ebf52a02b2b68ee3ff4ab3426431.tar.gz |
stat_tap_ui: add cleanup function.
Change-Id: I0275a6e0d5d151f086d96c6388b9fa647ea0085c
Reviewed-on: https://code.wireshark.org/review/19654
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
-rw-r--r-- | epan/epan.c | 2 | ||||
-rw-r--r-- | epan/stat_tap_ui.c | 12 | ||||
-rw-r--r-- | epan/stat_tap_ui.h | 2 |
3 files changed, 16 insertions, 0 deletions
diff --git a/epan/epan.c b/epan/epan.c index 0b12a690e7..182aae10f7 100644 --- a/epan/epan.c +++ b/epan/epan.c @@ -56,6 +56,7 @@ #include "capture_dissectors.h" #include "exported_pdu.h" #include "export_object.h" +#include "stat_tap_ui.h" #ifdef HAVE_LUA #include <lua.h> @@ -209,6 +210,7 @@ epan_cleanup(void) capture_dissector_cleanup(); export_pdu_cleanup(); export_object_cleanup(); + stat_tap_table_cleanup(); #ifdef HAVE_LUA wslua_cleanup(); #endif diff --git a/epan/stat_tap_ui.c b/epan/stat_tap_ui.c index d2428baf8a..9e6993366b 100644 --- a/epan/stat_tap_ui.c +++ b/epan/stat_tap_ui.c @@ -283,6 +283,18 @@ void free_stat_tables(stat_tap_table_ui* new_stat, new_stat_tap_gui_free_cb gui_ g_array_set_size(new_stat->tables, 0); } +static void +stat_cmd_arg_list_free(gpointer p, gpointer user_data _U_) +{ + g_free(p); +} + +void stat_tap_table_cleanup(void) +{ + g_slist_free(registered_stat_tables); + g_list_foreach(stat_cmd_arg_list, stat_cmd_arg_list_free, NULL); + g_list_free(stat_cmd_arg_list); +} /* * Editor modelines diff --git a/epan/stat_tap_ui.h b/epan/stat_tap_ui.h index 46d6813753..66319e28b1 100644 --- a/epan/stat_tap_ui.h +++ b/epan/stat_tap_ui.h @@ -200,6 +200,8 @@ WS_DLL_PUBLIC void list_stat_cmd_args(void); WS_DLL_PUBLIC void start_requested_stats(void); +extern void stat_tap_table_cleanup(void); + #ifdef __cplusplus } #endif /* __cplusplus */ |