Przeglądaj źródła

Fix for 14a5dccd1 (Bug 1564: Stalled connection attempts can be canceled promptly)

Source commit: 39f756e118172dbf4d6ccd83e2c53c580b5c120b
Martin Prikryl 8 lat temu
rodzic
commit
da08127a03
1 zmienionych plików z 10 dodań i 1 usunięć
  1. 10 1
      source/core/Queue.cpp

+ 10 - 1
source/core/Queue.cpp

@@ -2579,7 +2579,16 @@ void __fastcall TTerminalThread::SaveException(Exception & E, Exception *& Excep
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
 void __fastcall TTerminalThread::FatalAbort()
 void __fastcall TTerminalThread::FatalAbort()
 {
 {
-  FTerminal->FatalAbort();
+  if (FAbandoned)
+  {
+    // We cannot use TTerminal::FatalError as the terminal still runs on a backgroud thread,
+    // may have its TCallbackGuard armed right now.
+    throw ESshFatal(NULL, L"");
+  }
+  else
+  {
+    FTerminal->FatalAbort();
+  }
 }
 }
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
 void __fastcall TTerminalThread::CheckCancel()
 void __fastcall TTerminalThread::CheckCancel()