Skip to content

Commit f1adcc6

Browse files
committed
Improved fix for #1001: Checking tsValidating in TBaseVirtualTree.Destroy() is not enough, the TWorkerThread may be stuck in the first call to ChangeTreeStatesAsync() where tsValidating is not set.
1 parent d0c3df9 commit f1adcc6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Source/VirtualTrees.pas

+2-2
Original file line numberDiff line numberDiff line change
@@ -12234,7 +12234,7 @@ constructor TBaseVirtualTree.Create(AOwner: TComponent);
1223412234

1223512235
//----------------------------------------------------------------------------------------------------------------------
1223612236

12237-
destructor TBaseVirtualTree.Destroy;
12237+
destructor TBaseVirtualTree.Destroy();
1223812238
var
1223912239
WasValidating: Boolean;
1224012240
begin
@@ -12248,7 +12248,7 @@ destructor TBaseVirtualTree.Destroy;
1224812248
fAccessible := nil;
1224912249
end;
1225012250

12251-
WasValidating := (tsValidating in FStates);
12251+
WasValidating := (tsValidating in FStates) or (tsValidationNeeded in FStates); // Checking tsValidating is not enough, the TWorkerThread may be stuck in the first call to ChangeTreeStatesAsync()
1225212252
InterruptValidation(True);
1225312253
if WasValidating then
1225412254
begin

0 commit comments

Comments
 (0)