exported_object: add cleanup function.

Change-Id: If4c35d18db1dc982e981004838e0eabbf4479e78
Reviewed-on: https://code.wireshark.org/review/19653
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Dario Lombardo 2017-01-16 22:08:12 +01:00 committed by Michael Mann
parent baf2612d9e
commit baaff60b3b
3 changed files with 21 additions and 0 deletions

View File

@ -55,6 +55,7 @@
#include "print.h"
#include "capture_dissectors.h"
#include "exported_pdu.h"
#include "export_object.h"
#ifdef HAVE_LUA
#include <lua.h>
@ -207,6 +208,7 @@ epan_cleanup(void)
expert_cleanup();
capture_dissector_cleanup();
export_pdu_cleanup();
export_object_cleanup();
#ifdef HAVE_LUA
wslua_cleanup();
#endif

View File

@ -197,6 +197,21 @@ void eo_free_entry(export_object_entry_t *entry)
g_free(entry);
}
static void
free_eo_table(gpointer p, gpointer user_data _U_)
{
register_eo_t *table = (register_eo_t*)p;
g_free((gpointer)table->tap_listen_str);
g_free(table);
}
void export_object_cleanup(void)
{
g_slist_foreach(registered_eo_tables, free_eo_table, NULL);
g_slist_free(registered_eo_tables);
}
/*
* Editor modelines
*

View File

@ -135,6 +135,10 @@ WS_DLL_PUBLIC const char *eo_ct2ext(const char *content_type);
*/
WS_DLL_PUBLIC void eo_free_entry(export_object_entry_t *entry);
/** Free the export objects table
*/
extern void export_object_cleanup(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */