Browse Source

Prevent assertion in TFTPFileSystem::WaitForReply when reconnecting

Source commit: d58003d90a52d8e6c53775050fed802c0fd1fb83
Martin Prikryl 5 years ago
parent
commit
7cffe6e046
1 changed files with 9 additions and 1 deletions
  1. 9 1
      source/core/FtpFileSystem.cpp

+ 9 - 1
source/core/FtpFileSystem.cpp

@@ -2800,7 +2800,15 @@ bool __fastcall TFTPFileSystem::ProcessMessage()
 //---------------------------------------------------------------------------
 void __fastcall TFTPFileSystem::DiscardMessages()
 {
-  while (ProcessMessage());
+  try
+  {
+    while (ProcessMessage());
+  }
+  __finally
+  {
+    FReply = 0;
+    FCommandReply = 0;
+  }
 }
 //---------------------------------------------------------------------------
 void __fastcall TFTPFileSystem::WaitForMessages()