fix: several crash causes Host subtabs when connection is lost externally

This also changes the dodgy default text "Node" in any VirtualTree's cell to "-"

Refs #1875
This commit is contained in:
Ansgar Becker
2026-02-23 13:33:28 +01:00
parent 05886c43da
commit 4837405f19
2 changed files with 11 additions and 4 deletions

View File

@@ -1532,6 +1532,7 @@ begin
VT.EndUpdate;
VT.TextMargin := 6;
VT.Margin := 2;
VT.DefaultText := '-'; // "Node" by default
// Disable hottracking in non-Vista mode, looks ugly in XP, but nice in Vista
if (toUseExplorerTheme in VT.TreeOptions.PaintOptions) and (Win32MajorVersion >= 6) then
VT.TreeOptions.PaintOptions := VT.TreeOptions.PaintOptions + [toHotTrack]

View File

@@ -9456,6 +9456,8 @@ begin
if Sender = ListProcesses then begin
Idx := Sender.GetNodeData(Node);
Results := GridResult(Sender);
if not Results.Connection.Active then
Exit;
Results.RecNo := Idx^;
case Kind of
ikNormal, ikSelected: begin
@@ -9500,11 +9502,15 @@ var
begin
Idx := Sender.GetNodeData(Node);
Results := GridResult(Sender);
// See issue #3416
if (Results = nil) and (Sender <> ListVariables) then
Exit;
if Results <> nil then
// See issue #3416. Note: ListVariables does not depend on a live result, but on a StringList.
if Sender <> ListVariables then begin
// See issue #1875
if (Results = nil) or (not Results.Connection.Active) then
Exit;
Results.RecNo := Idx^;
end;
if (Sender = ListStatus) and (Column in [1,2,3]) then begin
CellText := Results.Col(1);