Hello,

in a couple of programs I'm using this idiom:


FMyThread:=TMyTread.Create;
FMyThread.FreeOnTerminate:=false;
FMyThread.OnTerminate:=@MyThreadTerminate

procedure TMyForm.MyThreadTerminate(Sender:TObject);
begin
  //do something with FMyThread then
  FreeAndNil(FMyThread);
end;


With fpc 2.6.4 it worked flawlessly, with fpc 3.0 sometimes it causes a sigsev somewhere inside CheckSynchronize.

I could find nothing here
http://wiki.freepascal.org/User_Changes_3.0
related to this.
I realize that's an implementation detail so probably what I did was wrong (was it?). What are the possible solutions (apart from omitting the call to FreeAndNil and setting FreeOnTerminate to true)?


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

Reply via email to