mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-14 17:29:39 +02:00
* readded BeforeDestructor that calls Destroying (delphi compatibility issue)
* uncommented code in Notification procedure (delphi compatibility issue) git-svn-id: trunk@13874 -
This commit is contained in:
parent
3cfcdb2ab9
commit
fff6e218af
@ -1557,6 +1557,7 @@ type
|
|||||||
procedure WriteState(Writer: TWriter); virtual;
|
procedure WriteState(Writer: TWriter); virtual;
|
||||||
constructor Create(AOwner: TComponent); virtual;
|
constructor Create(AOwner: TComponent); virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
procedure BeforeDestruction; override;
|
||||||
procedure DestroyComponents;
|
procedure DestroyComponents;
|
||||||
procedure Destroying;
|
procedure Destroying;
|
||||||
function ExecuteAction(Action: TBasicAction): Boolean; dynamic;
|
function ExecuteAction(Action: TBasicAction): Boolean; dynamic;
|
||||||
|
@ -237,7 +237,7 @@ end;
|
|||||||
Procedure TComponent.Notification(AComponent: TComponent;
|
Procedure TComponent.Notification(AComponent: TComponent;
|
||||||
Operation: TOperation);
|
Operation: TOperation);
|
||||||
|
|
||||||
//Var Runner : Longint;
|
Var Runner : Longint;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
If (Operation=opRemove) and Assigned(FFreeNotifies) then
|
If (Operation=opRemove) and Assigned(FFreeNotifies) then
|
||||||
@ -250,11 +250,9 @@ begin
|
|||||||
Exclude(FComponentState, csFreeNotification);
|
Exclude(FComponentState, csFreeNotification);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{ disabled this code: do we really have to notify the child components also? Each observer
|
If assigned(FComponents) then
|
||||||
should register itself to it's subject! }
|
|
||||||
{If assigned(FComponents) then
|
|
||||||
For Runner:=0 To FComponents.Count-1 do
|
For Runner:=0 To FComponents.Count-1 do
|
||||||
TComponent(FComponents.Items[Runner]).Notification(AComponent,Operation);}
|
TComponent(FComponents.Items[Runner]).Notification(AComponent,Operation);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -411,13 +409,20 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Procedure TComponent.BeforeDestruction;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Destroying;
|
||||||
|
inherited BeforeDestruction;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
Destructor TComponent.Destroy;
|
Destructor TComponent.Destroy;
|
||||||
|
|
||||||
Var
|
Var
|
||||||
I : Integer;
|
I : Integer;
|
||||||
L : TList;
|
L : TList;
|
||||||
begin
|
begin
|
||||||
Destroying;
|
|
||||||
If Assigned(FFreeNotifies) then
|
If Assigned(FFreeNotifies) then
|
||||||
begin
|
begin
|
||||||
L := FFreeNotifies;
|
L := FFreeNotifies;
|
||||||
|
Loading…
Reference in New Issue
Block a user