Skip to content

Commit 2f1bc9a

Browse files
committed
Added assertions which ensure that we are in the UI thread.
1 parent d7c1c0c commit 2f1bc9a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Source/VirtualTrees.pas

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8383,6 +8383,7 @@ procedure TVirtualTreeColumns.UpdatePositions(Force: Boolean = False);
83838383
function TVirtualTreeColumns.Add: TVirtualTreeColumn;
83848384

83858385
begin
8386+
Assert(GetCurrentThreadId = MainThreadId, 'UI controls may only be chnaged in UI thread.');
83868387
Result := TVirtualTreeColumn(inherited Add);
83878388
end;
83888389

@@ -29811,6 +29812,7 @@ function TBaseVirtualTree.InvalidateNode(Node: PVirtualNode): TRect;
2981129812

2981229813
begin
2981329814
Assert(Assigned(Node), 'Node must not be nil.');
29815+
Assert(GetCurrentThreadId = MainThreadId, 'UI controls may only be chnaged in UI thread.');
2981429816
// Reset height measured flag too to cause a re-issue of the OnMeasureItem event.
2981529817
Exclude(Node.States, vsHeightMeasured);
2981629818
if (FUpdateCount = 0) and HandleAllocated then

0 commit comments

Comments
 (0)