Código Delphi
[-]procedure Twindow_ver_refrigerio.FormClose(Sender: TObject; var Action: TCloseAction);
begin
FlabelList:=nil;
FLabelList.Free;
FLabelList2:=nil;
FLabelList2.Free;
FEditList:=nil;
FEditList.Free;
FEditList2:=nil;
FEditList2.Free;
FLabelList.Destroy;
FLabelList2.Destroy;
FEditList.Destroy;
FEditList2.Destroy;
end;
A mi parecer, no tiene mucho sentido lo que haces aquí:
- Pones a nil antes de hacer Free? Lo normal, seria liberar y después ponerlo a nil, pero para hacer esto, es mejor "FreeAndNil(FlabelList);" por ejemplo.
- El
destroy no se usa, hehe... esto te va a provocar un error. De ahí que te explote al cerrar el formulario.
Saludos.