[fpc-pascal]Free Instance

Luis Del Aguila aguila3000 at terra.com.pe
Wed Jan 29 04:26:43 CET 2003


I don't Understand, I compile this code with FPC 1.06 for Windows and the
directive compiler -S2 -Rintel.
is it a bug?.

 Thanks


 Type
   TClase1 = Class
     campo1:string;
   End;
   TClase2 = Class (TClase1)
     campo2:string;
   End;

 Var b:Tclase2;
 Begin
   b:=TClase2.create;
   b.campo1:='hola';
   b.campo2:='hola2';
   Writeln(b.campo2);
   b.free;                          //if free the instance .
   Writeln(b.campo2);     // Why the instance exist?
   Write('presione enter para terminar');readln
 End.









More information about the fpc-pascal mailing list