浏览代码

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

Source commit: 39f756e118172dbf4d6ccd83e2c53c580b5c120b
Martin Prikryl 8 年之前
父节点
当前提交
da08127a03
共有 1 个文件被更改,包括 10 次插入1 次删除
  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()
 {
-  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()