mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 06:49:27 +02:00
* Fix from Luiz Americo to avoid crash when a freenotification is registered during destroy. (bug ID 23031)
git-svn-id: trunk@22589 -
This commit is contained in:
parent
d6c8ebc1b9
commit
3cafdc2a58
@ -559,17 +559,12 @@ Procedure TComponent.FreeNotification(AComponent: TComponent);
|
||||
|
||||
begin
|
||||
If (Owner<>Nil) and (AComponent=Owner) then exit;
|
||||
if csDestroying in ComponentState then
|
||||
AComponent.Notification(Self,opRemove)
|
||||
else
|
||||
If not (Assigned(FFreeNotifies)) then
|
||||
FFreeNotifies:=TFpList.Create;
|
||||
If FFreeNotifies.IndexOf(AComponent)=-1 then
|
||||
begin
|
||||
If not (Assigned(FFreeNotifies)) then
|
||||
FFreeNotifies:=TFpList.Create;
|
||||
If FFreeNotifies.IndexOf(AComponent)=-1 then
|
||||
begin
|
||||
FFreeNotifies.Add(AComponent);
|
||||
AComponent.FreeNotification (self);
|
||||
end;
|
||||
FFreeNotifies.Add(AComponent);
|
||||
AComponent.FreeNotification (self);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user