[fpc-pascal] changes in TThread.OnTerminate in fcp-3.0?

Luca Olivetti luca at ventoso.org
Thu Dec 10 10:26:29 CET 2015


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



More information about the fpc-pascal mailing list