diff --git a/components/codetools/finddeclarationtool.pas b/components/codetools/finddeclarationtool.pas index 053a9e1fad..43712c756c 100644 --- a/components/codetools/finddeclarationtool.pas +++ b/components/codetools/finddeclarationtool.pas @@ -3179,6 +3179,14 @@ begin ReadNextAtom; AtomIsIdentifier(true); OldPos:=CurPos.StartPos; + ReadNextAtom; + if CurPos.Flag=cafPoint then begin + // unit.type + ReadNextAtom; + AtomIsIdentifier(true); + OldPos:=CurPos.StartPos; + ReadNextAtom; + end; // property has type Params.Save(OldInput); Params.SetIdentifier(Self,@Src[CurPos.StartPos],nil); diff --git a/ide/project.pp b/ide/project.pp index d194e4042d..a6c6b88e2f 100644 --- a/ide/project.pp +++ b/ide/project.pp @@ -3888,6 +3888,8 @@ procedure TProject.FindUnitsUsingSubComponent(SubComponent: TComponent; CurCount: Word; ReferenceComponent: TComponent; begin + if csDestroying in AComponent.ComponentState then exit; + // read all properties and remove doubles TypeInfo:=PTypeInfo(AComponent.ClassInfo); repeat @@ -3933,6 +3935,7 @@ begin OwnerComponent:=nil; AnUnitInfo:=FirstUnitWithComponent; while AnUnitInfo<>nil do begin + if csDestroying in AnUnitInfo.Component.ComponentState then continue; if AnUnitInfo.Component<>OwnerComponent then begin Search(AnUnitInfo,AnUnitInfo.Component); for i:=AnUnitInfo.Component.ComponentCount-1 downto 0 do