In our previous episode, Daniel Gaspary said:
>    gtree.TTree type has the following code:
> 
> How is possible then that the following program don't raise an error
> when the destructor (via free) is called?

Free only calls the destructor if self isn't nil.
 

      procedure TObject.Free;

        begin
           // the call via self avoids a warning
           if self<>nil then
             self.destroy;
        end;
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to