|
@@ -4909,7 +4909,12 @@ void __fastcall TCustomScpExplorerForm::OpenFolderOrWorkspace(const UnicodeStrin
|
|
|
void __fastcall TCustomScpExplorerForm::FormCloseQuery(TObject * /*Sender*/,
|
|
|
bool &CanClose)
|
|
|
{
|
|
|
- if (Terminal != NULL)
|
|
|
+ // See the comment in CloseApp()
|
|
|
+ if (NonVisualDataModule->Busy)
|
|
|
+ {
|
|
|
+ CanClose = false;
|
|
|
+ }
|
|
|
+ else if (Terminal != NULL)
|
|
|
{
|
|
|
if (Terminal->Active && WinConfiguration->ConfirmClosingSession)
|
|
|
{
|
|
@@ -10737,3 +10742,19 @@ void __fastcall TCustomScpExplorerForm::BrowseFile()
|
|
|
}
|
|
|
}
|
|
|
//---------------------------------------------------------------------------
|
|
|
+void __fastcall TCustomScpExplorerForm::CloseApp()
|
|
|
+{
|
|
|
+ // Called from TNonVisualDataModule::ExplorerActionsExecute, which sets busy flag.
|
|
|
+ // FormCloseQuery must check busy state, so that the application cannot be closed while busy by Alt+F4 and X button.
|
|
|
+ // So we clear the flag here.
|
|
|
+ DebugAssert(NonVisualDataModule->Busy);
|
|
|
+ NonVisualDataModule->EndBusy();
|
|
|
+ try
|
|
|
+ {
|
|
|
+ Close();
|
|
|
+ }
|
|
|
+ __finally
|
|
|
+ {
|
|
|
+ NonVisualDataModule->StartBusy();
|
|
|
+ }
|
|
|
+}
|