E
everhappy
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TComponent.FreeNotification(AComponent: TComponent);
begin
if (Owner = nil) or (AComponent.Owner <> Owner) then
begin
// Never acquire a reference to a component that is being deleted.
assert(not (csDestroying in (ComponentState + AComponent.ComponentState)), 'Component already destroyed: '+ Name);
if not Assigned(FFreeNotifies) then FFreeNotifies := TList.Create;
if FFreeNotifies.IndexOf(AComponent) < 0 then
begin
FFreeNotifies.Add(AComponent);
AComponent.FreeNotification(Self);//这是不是出现循环调用吗?
end;
end;
Include(FComponentState, csFreeNotification);
end;
该函数的功能就是把要通知的对象放在FFreeNotifies中,自已删除了就要通知子组件删除,但是添加了也有必要通知别人吗?有什么实际意义?
begin
if (Owner = nil) or (AComponent.Owner <> Owner) then
begin
// Never acquire a reference to a component that is being deleted.
assert(not (csDestroying in (ComponentState + AComponent.ComponentState)), 'Component already destroyed: '+ Name);
if not Assigned(FFreeNotifies) then FFreeNotifies := TList.Create;
if FFreeNotifies.IndexOf(AComponent) < 0 then
begin
FFreeNotifies.Add(AComponent);
AComponent.FreeNotification(Self);//这是不是出现循环调用吗?
end;
end;
Include(FComponentState, csFreeNotification);
end;
该函数的功能就是把要通知的对象放在FFreeNotifies中,自已删除了就要通知子组件删除,但是添加了也有必要通知别人吗?有什么实际意义?