mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-06 04:52:17 +02:00
* Call getOwner only once in several TPersistent methods (Patch from Luiz Americo, bug #21531)
git-svn-id: trunk@20574 -
This commit is contained in:
parent
1bf8ef2428
commit
0d545c68de
@ -61,12 +61,14 @@ end;
|
||||
function TPersistent.GetNamePath: string;
|
||||
|
||||
Var OwnerName :String;
|
||||
TheOwner: TPersistent;
|
||||
|
||||
begin
|
||||
Result:=ClassNAme;
|
||||
If GetOwner<>Nil then
|
||||
Result:=ClassName;
|
||||
TheOwner:=GetOwner;
|
||||
If TheOwner<>Nil then
|
||||
begin
|
||||
OwnerName:=GetOwner.GetNamePath;
|
||||
OwnerName:=TheOwner.GetNamePath;
|
||||
If OwnerName<>'' then Result:=OwnerName+'.'+Result;
|
||||
end;
|
||||
end;
|
||||
@ -77,10 +79,14 @@ end;
|
||||
{****************************************************************************}
|
||||
|
||||
procedure TInterfacedPersistent.AfterConstruction;
|
||||
|
||||
Var TheOwner: TPersistent;
|
||||
|
||||
begin
|
||||
inherited;
|
||||
if assigned(GetOwner) then
|
||||
GetOwner.GetInterface(IUnknown,FOwnerInterface);
|
||||
TheOwner:=GetOwner;
|
||||
if assigned(TheOwner) then
|
||||
TheOwner.GetInterface(IUnknown,FOwnerInterface);
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user