From f3e120816c1e74eda131f95a74e61777995c2c7b Mon Sep 17 00:00:00 2001 From: Pascal Quantin Date: Wed, 11 May 2016 15:16:44 +0200 Subject: Qt: add some cleanup function calls missing when leaving application Change-Id: I8f22d321e84daa36d4a40856b61d0844d3489cc2 Reviewed-on: https://code.wireshark.org/review/15374 Petri-Dish: Pascal Quantin Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin --- wireshark-qt.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'wireshark-qt.cpp') diff --git a/wireshark-qt.cpp b/wireshark-qt.cpp index b460483419..c549f0f169 100644 --- a/wireshark-qt.cpp +++ b/wireshark-qt.cpp @@ -422,7 +422,7 @@ int main(int argc, char *argv[]) { MainWindow *main_w; - int opt; + int opt, ret_val; gboolean arg_error = FALSE; char **ws_argv = argv; @@ -1414,7 +1414,23 @@ int main(int argc, char *argv[]) profile_store_persconffiles(FALSE); - return wsApp->exec(); + ret_val = wsApp->exec(); + + epan_cleanup(); + + AirPDcapDestroyContext(&airpdcap_ctx); + +#ifdef _WIN32 + /* Shutdown windows sockets */ + WSACleanup(); + + /* For some unknown reason, the "atexit()" call in "create_console()" + doesn't arrange that "destroy_console()" be called when we exit, + so we call it here if a console was created. */ + destroy_console(); +#endif /* _WIN32 */ + + return ret_val; } /* -- cgit v1.2.3