diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2016-05-11 15:16:44 +0200 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2016-05-13 12:53:56 +0000 |
commit | f3e120816c1e74eda131f95a74e61777995c2c7b (patch) | |
tree | 8d7dddd701cee2ad8d38c5f2163b07819b7248ca | |
parent | de61fb1cfbba8683c93672f38824202da13dad26 (diff) |
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 <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
-rw-r--r-- | wireshark-qt.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
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; } /* |