Add Lua cleanup on shutdown, to help with memory leak detection. Bug 5575 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5575)

From Robert G. Jakabosky

From me: cleanup so that it applies to trunk.

svn path=/trunk/; revision=52798
This commit is contained in:
Michael Mann 2013-10-23 16:47:02 +00:00
parent 25c43f9dc2
commit 79d58dc670
3 changed files with 11 additions and 0 deletions

View File

@ -128,6 +128,9 @@ epan_cleanup(void)
prefs_cleanup();
packet_cleanup();
expert_cleanup();
#ifdef HAVE_LUA
wslua_cleanup();
#endif
#ifdef HAVE_LIBGNUTLS
gnutls_global_deinit();
#endif

View File

@ -486,6 +486,13 @@ int wslua_init(register_cb cb, gpointer client_data) {
return 0;
}
int wslua_cleanup(void) {
/* cleanup lua */
lua_close(L);
L = NULL;
return 0;
}
lua_State* wslua_state(void) { return L; }
/*

View File

@ -457,6 +457,7 @@ extern void clear_outstanding_TreeItem(void);
extern void wslua_print_stack(char* s, lua_State* L);
extern int wslua_init(register_cb cb, gpointer client_data);
extern int wslua_cleanup(void);
extern tap_extractor_t wslua_get_tap_extractor(const gchar* name);
extern int wslua_set_tap_enums(lua_State* L);