Browse Source

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

Source commit: 43e1433036fa78b6d1592ffebde3cd8c86da8a37
Martin Prikryl 7 years ago
parent
commit
653c6e65f6
1 changed files with 5 additions and 4 deletions
  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
   // this has to be one of the very first things to do
   StopUpdateThread();
   StopUpdateThread();
 
 
-  SessionsPageControl->Images = NULL;
-  SAFE_DESTROY(FSessionColors);
-  SAFE_DESTROY(FSessionsDragDropFilesEx);
-
   delete FCustomCommandLocalFileList;
   delete FCustomCommandLocalFileList;
   delete FCustomCommandRemoteFileList;
   delete FCustomCommandRemoteFileList;
   delete FCustomCommandMenu;
   delete FCustomCommandMenu;
@@ -371,6 +367,11 @@ __fastcall TCustomScpExplorerForm::~TCustomScpExplorerForm()
 
 
   SAFE_DESTROY(FDocks);
   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][0]);
   SAFE_DESTROY(FHistoryMenu[0][1]);
   SAFE_DESTROY(FHistoryMenu[0][1]);
   SAFE_DESTROY(FHistoryMenu[1][0]);
   SAFE_DESTROY(FHistoryMenu[1][0]);