From 186babc6ba30e635d29f235d95e388dbe434fa26 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Fri, 23 Aug 2013 02:34:51 +0000 Subject: [PATCH] When we close a main window, delete the welcome screen, which in turn deletes the interface list, which in turn kills off the dumpcap process it may be running. This should hopefully keep us from leaving dumpcap processes running in the background on Windows. (Am I the only one running QtShark on that platform?) svn path=/trunk/; revision=51485 --- ui/qt/interface_tree.cpp | 5 ++--- ui/qt/main_window.cpp | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ui/qt/interface_tree.cpp b/ui/qt/interface_tree.cpp index 607146a755..a630f8657a 100644 --- a/ui/qt/interface_tree.cpp +++ b/ui/qt/interface_tree.cpp @@ -73,11 +73,10 @@ InterfaceTree::~InterfaceTree() { while (*iter) { QList *points; - QVariant v; - v = (*iter)->data(1, Qt::UserRole); - points = v.value *>(); + points = (*iter)->data(1, Qt::UserRole).value *>(); delete(points); + ++iter; } } diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp index a06c2b4367..2517084104 100644 --- a/ui/qt/main_window.cpp +++ b/ui/qt/main_window.cpp @@ -386,6 +386,9 @@ void MainWindow::closeEvent(QCloseEvent *event) { return; } + // Make sure we kill any open dumpcap processes. + delete main_welcome_; + if(testCaptureFileClose(true)) { /* QCoreApplication::quit() won't exit properly * because when during initialization phase we are not in the event loop */