summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Warren <pdw@ex-parrot.com>2017-01-03 21:53:09 +0000
committerPaul Warren <pdw@ex-parrot.com>2017-01-03 21:53:09 +0000
commitbc66e31834419c12770d790694bc9e60eccd11e2 (patch)
tree4ae836c318b2ea1e1d4834b607dae889b47c300b
parent5340a3b9af25e3330ca7e234aff159cda19e9ec7 (diff)
downloadiftop-bc66e31834419c12770d790694bc9e60eccd11e2.zip
Clean up libpcap on exit - Brian Russell <brussell@brocade.com>
On exit, call pcap_close() so that any resources used internally by libpcap can be cleaned up. http://lists.beasts.org/pipermail/iftop-users/2016-September/000455.html
-rw-r--r--iftop.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/iftop.c b/iftop.c
index a090dcf..f9875c9 100644
--- a/iftop.c
+++ b/iftop.c
@@ -839,6 +839,8 @@ int main(int argc, char **argv) {
}
pthread_cancel(thread);
+ pthread_join(thread, NULL);
+ pcap_close(pd);
ui_finish();