Skip to content

Commit 717e6ea

Browse files
committed
Improved the workaround for issue #1001: Worst case we have two synchonized calls from ChangeTreeStatesAsync() in the queue.
1 parent 7bbd6da commit 717e6ea

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Source/VirtualTrees.pas

+5-1
Original file line numberDiff line numberDiff line change
@@ -12194,7 +12194,11 @@ destructor TBaseVirtualTree.Destroy;
1219412194
WasValidating := (tsValidating in FStates);
1219512195
InterruptValidation(True);
1219612196
if WasValidating then
12197-
CheckSynchronize(); // Make sure to dequeue all synchronized calls from ChangeTreeStatesAsync(), fixes mem leak reported in issue #1001.
12197+
begin
12198+
// Make sure we dequeue the two synchronized calls from ChangeTreeStatesAsync(), fixes mem leak and AV reported in issue #1001, but is more a workaround.
12199+
CheckSynchronize();
12200+
CheckSynchronize();
12201+
end;// if
1219812202
Exclude(FOptions.FMiscOptions, toReadOnly);
1219912203
// Make sure there is no reference remaining to the releasing tree.
1220012204
TWorkerThread.ReleaseThreadReference();

0 commit comments

Comments
 (0)