IDE: notifying referred units: ignoring components with csDestroying

git-svn-id: trunk@16018 -
This commit is contained in:
mattias 2008-08-10 21:20:32 +00:00
parent 9826f7615d
commit d80f64ab53
2 changed files with 11 additions and 0 deletions

View File

@ -3179,6 +3179,14 @@ begin
ReadNextAtom; ReadNextAtom;
AtomIsIdentifier(true); AtomIsIdentifier(true);
OldPos:=CurPos.StartPos; OldPos:=CurPos.StartPos;
ReadNextAtom;
if CurPos.Flag=cafPoint then begin
// unit.type
ReadNextAtom;
AtomIsIdentifier(true);
OldPos:=CurPos.StartPos;
ReadNextAtom;
end;
// property has type // property has type
Params.Save(OldInput); Params.Save(OldInput);
Params.SetIdentifier(Self,@Src[CurPos.StartPos],nil); Params.SetIdentifier(Self,@Src[CurPos.StartPos],nil);

View File

@ -3888,6 +3888,8 @@ procedure TProject.FindUnitsUsingSubComponent(SubComponent: TComponent;
CurCount: Word; CurCount: Word;
ReferenceComponent: TComponent; ReferenceComponent: TComponent;
begin begin
if csDestroying in AComponent.ComponentState then exit;
// read all properties and remove doubles // read all properties and remove doubles
TypeInfo:=PTypeInfo(AComponent.ClassInfo); TypeInfo:=PTypeInfo(AComponent.ClassInfo);
repeat repeat
@ -3933,6 +3935,7 @@ begin
OwnerComponent:=nil; OwnerComponent:=nil;
AnUnitInfo:=FirstUnitWithComponent; AnUnitInfo:=FirstUnitWithComponent;
while AnUnitInfo<>nil do begin while AnUnitInfo<>nil do begin
if csDestroying in AnUnitInfo.Component.ComponentState then continue;
if AnUnitInfo.Component<>OwnerComponent then begin if AnUnitInfo.Component<>OwnerComponent then begin
Search(AnUnitInfo,AnUnitInfo.Component); Search(AnUnitInfo,AnUnitInfo.Component);
for i:=AnUnitInfo.Component.ComponentCount-1 downto 0 do for i:=AnUnitInfo.Component.ComponentCount-1 downto 0 do