Ver Mensaje Individual
  #4  
Antiguo 26-09-2006
[maeyanes] maeyanes is offline
Capo de los Capos
 
Registrado: may 2003
Ubicación: Campeche, México
Posts: 2.732
Reputación: 24
maeyanes Va por buen camino
Bueno, al decir que son colecciones pensé que se refería a descendientes de TCollection y TCollectionItem, y si revisas el código de TCollectionItem.Destroy, verás que este se elimina de la collección que lo contiene al momento de destruirse, de ahí viene mi respuesta.

De Classes.pas:

Código Delphi [-]
destructor TCollectionItem.Destroy;
begin
  SetCollection(nil);
  inherited Destroy;
end;

procedure TCollectionItem.SetCollection(Value: TCollection);
begin
  if FCollection <> Value then
  begin
    if FCollection <> nil then FCollection.RemoveItem(Self);
    if Value <> nil then Value.InsertItem(Self);
  end;
end;

Ahora, si está usando un TList o un TListObject, entonces si, el comportamiento sería el que mencionas...


Saludos...
Responder Con Cita