forked from osmocom/wireshark
tap: add cleanup routine.
Change-Id: I460b053880ed43a7377b7696531bbaeb0fd0d68b Reviewed-on: https://code.wireshark.org/review/19764 Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
parent
e59583624c
commit
0b25b1ab07
|
@ -217,6 +217,7 @@ epan_cleanup(void)
|
|||
conversation_table_cleanup();
|
||||
conversation_filters_cleanup();
|
||||
reassembly_table_cleanup();
|
||||
tap_cleanup();
|
||||
packet_cleanup();
|
||||
expert_cleanup();
|
||||
capture_dissector_cleanup();
|
||||
|
|
21
epan/tap.c
21
epan/tap.c
|
@ -744,6 +744,27 @@ union_of_tap_listener_flags(void)
|
|||
return flags;
|
||||
}
|
||||
|
||||
void tap_cleanup(void)
|
||||
{
|
||||
volatile tap_listener_t *elem_lq;
|
||||
volatile tap_listener_t *head_lq = tap_listener_queue;
|
||||
tap_dissector_t *elem_dl;
|
||||
tap_dissector_t *head_dl = tap_dissector_list;
|
||||
|
||||
while(head_lq){
|
||||
elem_lq = head_lq;
|
||||
head_lq = head_lq->next;
|
||||
free_tap_listener(elem_lq);
|
||||
}
|
||||
|
||||
while(head_dl){
|
||||
elem_dl = head_dl;
|
||||
head_dl = head_dl->next;
|
||||
g_free((char*)elem_dl->name);
|
||||
g_free((gpointer)elem_dl);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Editor modelines - http://www.wireshark.org/tools/modelines.html
|
||||
*
|
||||
|
|
|
@ -259,6 +259,10 @@ WS_DLL_PUBLIC guint union_of_tap_listener_flags(void);
|
|||
*/
|
||||
WS_DLL_PUBLIC const void *fetch_tapped_data(int tap_id, int idx);
|
||||
|
||||
/** Clean internal structures
|
||||
*/
|
||||
extern void tap_cleanup(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
|
Loading…
Reference in New Issue