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:40:13 +01:00
parent 5e34fa994f
commit 1029657e9c
2 changed files with 11 additions and 4 deletions

View File

@@ -1491,6 +1491,7 @@ begin
end;
VT.EndUpdate;
end;
VT.DefaultText := '-'; // "Node" by default
{$IFNDEF WINDOWS}
// Disable grid lines, looks ok on Windows with dotted light lines, but not on macOS and Linux
if (toHotTrack in VT.TreeOptions.PaintOptions) then

View File

@@ -9208,6 +9208,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
@@ -9252,11 +9254,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);