+ Fix in TComponent destroy FreeNotifications.

This commit is contained in:
michael 2004-09-22 18:48:31 +00:00
parent 8a1a277673
commit 8b3a3858eb

View File

@ -374,16 +374,24 @@ end;
Destructor TComponent.Destroy; Destructor TComponent.Destroy;
Var Runner : Longint; Var
I : Integer;
begin begin
Destroying; Destroying;
If Assigned(FFreeNotifies) then If Assigned(FFreeNotifies) then
begin begin
For Runner:=0 To FFreeNotifies.Count-1 do I:=FFreeNotifies.Count-1;
TComponent(FFreeNotifies.Items[Runner]).Notification (self,opRemove); While (I>=0) do
FFreeNotifies.Free; begin
FFreeNotifies:=Nil; TComponent(FFreeNotifies.Items[I]).Notification (self,opRemove);
If (FFreeNotifies=Nil) then
I:=0
else if (I>FFreeNotifies.Count) then
I:=FFreeNotifies.Count;
dec(i);
end;
FreeAndNil(FFreeNotifies);
end; end;
DestroyComponents; DestroyComponents;
If FOwner<>Nil Then FOwner.RemoveComponent(Self); If FOwner<>Nil Then FOwner.RemoveComponent(Self);
@ -540,7 +548,10 @@ end;
{ {
$Log$ $Log$
Revision 1.3 2004-08-07 16:44:35 florian Revision 1.4 2004-09-22 18:48:31 michael
+ Fix in TComponent destroy FreeNotifications.
Revision 1.3 2004/08/07 16:44:35 florian
* tcomponent.destroying is now called in tcomponent.beforedestruction * tcomponent.destroying is now called in tcomponent.beforedestruction
Revision 1.2 2004/01/12 17:44:22 peter Revision 1.2 2004/01/12 17:44:22 peter