TListView: call OnDeletion also when destroying. Issue #39391.

This commit is contained in:
Bart 2021-09-23 14:15:48 +02:00
parent 736bc5f5b4
commit 6eca378f9d

View File

@ -588,7 +588,7 @@ begin
Delete(AItem)
else
//if you change the code below, make sure to change it in TCustomListView.Delete as well
if not (csDestroying in ComponentState) and Assigned(FOnDeletion) then
if {not (csDestroying in ComponentState) and} Assigned(FOnDeletion) then
FOnDeletion(Self, AItem);
end;
@ -610,7 +610,7 @@ begin
AItem.Delete;
Exit;
end;
if not (csDestroying in ComponentState) and Assigned(FOnDeletion) then
if {not (csDestroying in ComponentState) and} Assigned(FOnDeletion) then
FOnDeletion(Self, AItem);
end;