From 0e517799c82ba7071d88510c32d92bf2ebea5fe4 Mon Sep 17 00:00:00 2001 From: Saleem Edah-Tally Date: Sun, 13 Jul 2025 22:36:09 +0200 Subject: [PATCH] Cancel scanning if window closure is requested. The job is cancelled but the window remains open and functional. At least, the application survives; a crash would happen without this patch. --- XS7.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/XS7.cpp b/XS7.cpp index 3cbe2d6..ea8f7ff 100644 --- a/XS7.cpp +++ b/XS7.cpp @@ -75,6 +75,12 @@ void XS7::OnClose(wxCloseEvent& evt) evt.Skip(false); return; } + if(m_insaneWidget->IsScanning()) + { + m_insaneWidget->CancelScanning(); + evt.Skip(false); // The window remains open. + return; + } evt.Skip(); }