IDE: fixed freeing nested TComponentInterfaces

git-svn-id: trunk@15748 -
This commit is contained in:
mattias 2008-07-11 15:31:58 +00:00
parent acc9c7d69c
commit 1b29789902

View File

@ -914,6 +914,7 @@ var
i: integer; i: integer;
AForm: TCustomForm; AForm: TCustomForm;
AWinControl: TWinControl; AWinControl: TWinControl;
IsJIT: Boolean;
Begin Begin
CompIntf := TComponentInterface(FindComponent(AComponent)); CompIntf := TComponentInterface(FindComponent(AComponent));
if CompIntf <> nil then if CompIntf <> nil then
@ -922,8 +923,8 @@ Begin
{$IFDEF IDE_DEBUG} {$IFDEF IDE_DEBUG}
DebugLn(['TCustomFormEditor.DeleteComponent ',DbgSName(AComponent),' IsJITComponent=',IsJITComponent(AComponent),' FreeComponent=',FreeComponent]); DebugLn(['TCustomFormEditor.DeleteComponent ',DbgSName(AComponent),' IsJITComponent=',IsJITComponent(AComponent),' FreeComponent=',FreeComponent]);
{$ENDIF} {$ENDIF}
if IsJITComponent(AComponent) then begin IsJIT:=IsJITComponent(AComponent);
// value is a top level component if IsJIT or (csInline in AComponent.ComponentState) then begin
i:=AComponent.ComponentCount-1; i:=AComponent.ComponentCount-1;
while i>=0 do begin while i>=0 do begin
DeleteComponent(AComponent.Components[i],FreeComponent); DeleteComponent(AComponent.Components[i],FreeComponent);
@ -931,8 +932,11 @@ Begin
if i>AComponent.ComponentCount-1 then if i>AComponent.ComponentCount-1 then
i:=AComponent.ComponentCount-1; i:=AComponent.ComponentCount-1;
end; end;
if PropertyEditorHook.LookupRoot=AComponent then end;
PropertyEditorHook.LookupRoot:=nil; if PropertyEditorHook.LookupRoot=AComponent then
PropertyEditorHook.LookupRoot:=nil;
if IsJITComponent(AComponent) then begin
// value is a top level component
if JITFormList.IsJITForm(AComponent) then begin if JITFormList.IsJITForm(AComponent) then begin
// free/unbind a form component // free/unbind a form component
if FreeComponent then if FreeComponent then