diff --git a/ui/qt/wireshark_main_window.cpp b/ui/qt/wireshark_main_window.cpp index 186fed40f2..b30eb1cc5d 100644 --- a/ui/qt/wireshark_main_window.cpp +++ b/ui/qt/wireshark_main_window.cpp @@ -932,6 +932,13 @@ void WiresharkMainWindow::keyPressEvent(QKeyEvent *event) { } void WiresharkMainWindow::closeEvent(QCloseEvent *event) { + if (main_ui_->actionCaptureStop->isEnabled()) { + // Capture is running, we should stop it before close and ignore the event + stopCapture(); + event->ignore(); + return; + } + saveWindowGeometry(); /* If we're in the middle of stopping a capture, don't do anything;