瀏覽代碼

Bug 1804: Failure while closing application and suspending computer after operation completion

https://winscp.net/tracker/1804

Source commit: 6b03037f5fcb8790a72377d90346234341e4d7ba
Martin Prikryl 6 年之前
父節點
當前提交
3d11a435c7
共有 2 個文件被更改,包括 10 次插入3 次删除
  1. 9 3
      source/forms/CustomScpExplorer.cpp
  2. 1 0
      source/forms/CustomScpExplorer.h

+ 9 - 3
source/forms/CustomScpExplorer.cpp

@@ -162,6 +162,7 @@ __fastcall TCustomScpExplorerForm::TCustomScpExplorerForm(TComponent* Owner):
     FFormRestored(false),
     TForm(Owner)
 {
+  FInvalid = false;
   FCurrentSide = osRemote;
   FEverShown = false;
   FDocks = new TList();
@@ -288,6 +289,7 @@ __fastcall TCustomScpExplorerForm::TCustomScpExplorerForm(TComponent* Owner):
 //---------------------------------------------------------------------------
 __fastcall TCustomScpExplorerForm::~TCustomScpExplorerForm()
 {
+  FInvalid = true;
   // this has to be one of the very first things to do
   StopUpdateThread();
   // This is needed when shuting down Windows only. Otherwise it's already set NULL from Execute()
@@ -8911,9 +8913,13 @@ void __fastcall TCustomScpExplorerForm::QueueSplitterDblClick(TObject * /*Sender
 //---------------------------------------------------------------------------
 void __fastcall TCustomScpExplorerForm::WMWinIniChange(TMessage & Message)
 {
-  WinConfiguration->ResetSysDarkTheme();
-  ConfigurationChanged();
-  ConfigureInterface();
+  // Do not handle, when shutting down anyway (maybe also when not setup completelly yet?)
+  if (FInvalid)
+  {
+    WinConfiguration->ResetSysDarkTheme();
+    ConfigurationChanged();
+    ConfigureInterface();
+  }
   TForm::Dispatch(&Message);
 }
 //---------------------------------------------------------------------------

+ 1 - 0
source/forms/CustomScpExplorer.h

@@ -280,6 +280,7 @@ private:
   bool FNeedSession;
   TTerminal * FFileFindTerminal;
   UnicodeString FFileColorsCurrent;
+  bool FInvalid;
 
   bool __fastcall GetEnableFocusedOperation(TOperationSide Side, int FilesOnly);
   bool __fastcall GetEnableSelectedOperation(TOperationSide Side, int FilesOnly);