Browse Source

Bug 1829: Failure when changing directory using tree after resuming system from sleep (2nd)

https://winscp.net/tracker/1829

Source commit: 1a4c0edc57f3e32efe7fa8f5d2173cfec61f07f7
Martin Prikryl 5 years ago
parent
commit
d98572025b
1 changed files with 9 additions and 2 deletions
  1. 9 2
      source/components/UnixDriveView.cpp

+ 9 - 2
source/components/UnixDriveView.cpp

@@ -487,7 +487,11 @@ void __fastcall TCustomUnixDriveView::Change(TTreeNode * Node)
         }
 
         FDirectoryLoaded = false;
-        StartBusy();
+        bool SetBusy = !ControlState.Contains(csRecreating);
+        if (SetBusy)
+        {
+          StartBusy();
+        }
         try
         {
           Terminal->ChangeDirectory(NodePathName(Node));
@@ -495,7 +499,10 @@ void __fastcall TCustomUnixDriveView::Change(TTreeNode * Node)
         }
         __finally
         {
-          EndBusy();
+          if (SetBusy)
+          {
+            EndBusy();
+          }
           if (!FDirectoryLoaded)
           {
             DebugAssert(!FIgnoreChange);