Quellcode durchsuchen

Merge branch 'master' into dev

# Conflicts:
#	source/WinSCP.cbproj

Source commit: adaafadba18ce5f40b61897a5e99d4f0cf7f3736
Martin Prikryl vor 8 Jahren
Ursprung
Commit
67eb8bc489
1 geänderte Dateien mit 17 neuen und 16 gelöschten Zeilen
  1. 17 16
      source/forms/CustomScpExplorer.cpp

+ 17 - 16
source/forms/CustomScpExplorer.cpp

@@ -5903,31 +5903,32 @@ void __fastcall TCustomScpExplorerForm::LastTerminalClosed(TObject * /*Sender*/)
   UpdateControls();
   SessionColor = TColor(0);
   UpdateRemotePathComboBox(false);
-  try
-  {
-    NeedSession(true);
-  }
-  catch (EAbort &)
-  {
-    // swallow
-    // The TTerminalManager does not expect the OnLastTerminalClose to throw without trying to connect
-  }
+  NeedSession(true);
 }
 //---------------------------------------------------------------------------
 void __fastcall TCustomScpExplorerForm::NeedSession(bool ReloadSessions)
 {
   try
   {
-    TTerminalManager::Instance()->NewSession(false, L"", ReloadSessions, this);
-  }
-  __finally
-  {
-    if (!WinConfiguration->KeepOpenWhenNoSession &&
-        (!Terminal || !Terminal->Active))
+    try
     {
-      TerminateApplication();
+      TTerminalManager::Instance()->NewSession(false, L"", ReloadSessions, this);
+    }
+    __finally
+    {
+      if (!WinConfiguration->KeepOpenWhenNoSession &&
+          (!Terminal || !Terminal->Active))
+      {
+        TerminateApplication();
+      }
     }
   }
+  catch (EAbort &)
+  {
+    // swallow
+    // The TTerminalManager does not expect the OnLastTerminalClose to throw without trying to connect.
+    // Also when called from TWinControl.UpdateShowing => CMShowingChanged, the showing is aborted on exception
+  }
 }
 //---------------------------------------------------------------------------
 void __fastcall TCustomScpExplorerForm::DoTerminalListChanged(bool Force)