El 13/06/2017 a las 21:04, Gabor Boros escribió:

Cannot have a simple test case just a dumb example.

procedure TForm1.FormCreate(Sender: TObject);
var
   x:TPanel;

begin
   x.Free;
end;

With Linux no error (x is Nil before the Free call), with Windows got SIGSEGV (x is not Nil before the Free call). Is it a Lazarus thing or come from FPC?

Hello,

That's wrong for sure, x is not initialized to nil, not in Linux nor in Windows. Procedure variables must be always initialized by hand. With that code you will get a warning from the compiler about uninitialized variable use.

--

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to