浏览代码

Bug fix: Failure when closing the main window with a colored session

Source commit: 43e1433036fa78b6d1592ffebde3cd8c86da8a37
Martin Prikryl 7 年之前
父节点
当前提交
653c6e65f6
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      source/forms/CustomScpExplorer.cpp

+ 5 - 4
source/forms/CustomScpExplorer.cpp

@@ -304,10 +304,6 @@ __fastcall TCustomScpExplorerForm::~TCustomScpExplorerForm()
   // this has to be one of the very first things to do
   StopUpdateThread();
 
-  SessionsPageControl->Images = NULL;
-  SAFE_DESTROY(FSessionColors);
-  SAFE_DESTROY(FSessionsDragDropFilesEx);
-
   delete FCustomCommandLocalFileList;
   delete FCustomCommandRemoteFileList;
   delete FCustomCommandMenu;
@@ -371,6 +367,11 @@ __fastcall TCustomScpExplorerForm::~TCustomScpExplorerForm()
 
   SAFE_DESTROY(FDocks);
 
+  SessionsPageControl->Images = NULL;
+  // only after clearing Terminal (after DoTerminalListChanged => ... => AddSessionColor is called)
+  SAFE_DESTROY(FSessionColors);
+  SAFE_DESTROY(FSessionsDragDropFilesEx);
+
   SAFE_DESTROY(FHistoryMenu[0][0]);
   SAFE_DESTROY(FHistoryMenu[0][1]);
   SAFE_DESTROY(FHistoryMenu[1][0]);