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.
This commit is contained in:
Saleem Edah-Tally
2025-07-13 22:36:09 +02:00
parent 2b9290e4d8
commit 0e517799c8

View File

@@ -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();
}