* Fixed resolving references; FFixups was being freed too early

git-svn-id: trunk@10587 -
This commit is contained in:
michael 2008-03-29 20:00:41 +00:00
parent f251d2fded
commit 9d3d2bba0b

View File

@ -902,34 +902,31 @@ var
SavedOwner, SavedParent: TComponent;
begin
{ Read properties }
while not EndOfList do
ReadProperty(Instance);
ReadListEnd;
{ Read children }
SavedOwner := Owner;
SavedParent := Parent;
try
{ Read properties }
Owner := Instance.GetChildOwner;
if not Assigned(Owner) then
Owner := Root;
Parent := Instance.GetChildParent;
while not EndOfList do
ReadProperty(Instance);
ReadComponent(nil);
ReadListEnd;
{ Read children }
SavedOwner := Owner;
SavedParent := Parent;
try
Owner := Instance.GetChildOwner;
if not Assigned(Owner) then
Owner := Root;
Parent := Instance.GetChildParent;
while not EndOfList do
ReadComponent(nil);
ReadListEnd;
finally
Owner := SavedOwner;
Parent := SavedParent;
end;
{ Fixup references if necessary (normally only if this is the root) }
DoFixupReferences;
finally
FreeAndNil(FFixups);
Owner := SavedOwner;
Parent := SavedParent;
end;
{ Fixup references if necessary (normally only if this is the root) }
If (Instance=FRoot) then
DoFixupReferences;
end;
{$ifndef FPUNONE}