Ver Mensaje Individual
  #1  
Antiguo 26-03-2014
jlrbotella jlrbotella is offline
Miembro
 
Registrado: ene 2007
Posts: 185
Reputación: 18
jlrbotella Va por buen camino
Liberar forms

Hola compañeros:

¿Sabéis como se puede liberar la memoria de un Form?. Actualmente realizo estos procedimientos, pero realmente no me libera la memoria:

Ejemplo 1

Código Delphi [-]
var
  fVentana : TForm2;
begin
  try
    fVentana := TForm2.Create(nil);
    fVentana.ShowModal;
  finally
    fVentana.free;
  end;

  ShowMessage(fVentana.variable); // Aquí debería fallar pero no lo hace
end;

Ejemplo 2

Código Delphi [-]
var
  fVentana : TForm2;
begin
  try
    fVentana := TForm2.Create(nil);
    fVentana.ShowModal;
  finally
    fVentana.free;
    fVentana := nil;
  end;

  ShowMessage(fVentana.variable); // Aquí falla
end;
Responder Con Cita