Răsfoiți Sursa

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

Source commit: 43e1433036fa78b6d1592ffebde3cd8c86da8a37
Martin Prikryl 7 ani în urmă
părinte
comite
653c6e65f6
1 a modificat fișierele cu 5 adăugiri și 4 ștergeri
  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]);