Hola
Roman de lo que sugeriste tengo unas dudas ya que intente aplicarlo y no pude :P
Esta parte no la tengo poner verdad? o si???
Cita:
Empezado por roman
Código Delphi [-]
destructor TComponent.Destroy;
begin
Destroying;
if FFreeNotifies <> nil then
begin
while Assigned(FFreeNotifies) and (FFreeNotifies.Count > 0) do
TComponent(FFreeNotifies[FFreeNotifies.Count - 1]).Notification(Self, opRemove);
FreeAndNil(FFreeNotifies);
end;
DestroyComponents;
if FOwner <> nil then FOwner.RemoveComponent(Self);
inherited Destroy;
end;
|
Y en esta no me reconoce el procedure TForm1.Notification me falta alguna declaración en el USES???
Cita:
Empezado por roman
Entonces, la parte que faltaría, es redefinir el método Notification de TForm1 para, ahí sí, poner en nil la variable:
Código Delphi [-]
procedure TForm1.Notification(AComponent: TComponent; Operation: TOperation);
begin
inherited;
if (AComponent = Form2) and (Operation = opRemove) then
Form2 := nil;
end;
// Saludos
|
Gracias! Saludos.