Skip to content

Commit

Permalink
Fixed issue JAM-Software#760: TVirtualTreeColumns.GetFirstVisibleColu…
Browse files Browse the repository at this point in the history
…mn() cause AV if called between BeginUpdate() and EndUpdate()

# Conflicts:
#	CHANGES.txt
  • Loading branch information
Joachim Marder authored and ValtsS committed Jan 25, 2019
1 parent a9d1e2a commit 501e9bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/VirtualTrees.pas
Original file line number Diff line number Diff line change
Expand Up @@ -10642,6 +10642,8 @@ function TVirtualTreeColumns.GetFirstVisibleColumn(ConsiderAllowFocus: Boolean =

begin
Result := InvalidColumn;
if (UpdateCount > 0) or (csLoading in Header.TreeView.ComponentState) then
exit; // See issue #760
for I := 0 to Count - 1 do
if (coVisible in Items[FPositionToIndex[I]].FOptions) and
( (not ConsiderAllowFocus) or
Expand All @@ -10666,6 +10668,8 @@ function TVirtualTreeColumns.GetLastVisibleColumn(ConsiderAllowFocus: Boolean =

begin
Result := InvalidColumn;
if (UpdateCount > 0) or (csLoading in Header.TreeView.ComponentState) then
exit; // See issue #760
for I := Count - 1 downto 0 do
if (coVisible in Items[FPositionToIndex[I]].FOptions) and
( (not ConsiderAllowFocus) or
Expand Down

0 comments on commit 501e9bd

Please sign in to comment.