Bläddra i källkod

Bug fix: When connecting disconnected session the directory might be loaded twice

(cherry picked from commit 6c45fb1167fac358b34988f16ce99330304aedf8)

Source commit: 3ed32d0d14f5e51cd5f6a8af884cfef3b429259a
Martin Prikryl 4 år sedan
förälder
incheckning
fd0a2b994a
1 ändrade filer med 5 tillägg och 1 borttagningar
  1. 5 1
      source/core/Terminal.cpp

+ 5 - 1
source/core/Terminal.cpp

@@ -1672,7 +1672,11 @@ void __fastcall TTerminal::Reopen(int Params)
   {
     FReadCurrentDirectoryPending = false;
     FReadDirectoryPending = false;
-    FSuspendTransaction = true;
+    // Not sure why we are suspeding the transaction in the first place,
+    // but definitelly when set while connecting auto loaded workspace session, it causes loading the directory twice.
+    // (when reconnecting lost connection, it's usually prevented by cached directory)
+    // Preventing that by suspeding transaction only when there is one.
+    FSuspendTransaction = (FInTransaction > 0);
     FExceptionOnFail = 0;
     // typically, we avoid reading directory, when there is operation ongoing,
     // for file list which may reference files from current directory