[fpc-pascal] TThread.OnTerminate never called

Sven Barth pascaldragon at googlemail.com
Fri Apr 26 10:19:40 CEST 2019

Am 21.04.2019 um 18:22 schrieb Dennis:
> I am using FPC 3.0.4 Lazarus 2.00 on windows 64
> I created a subclass of TThread and found out that the 
> TThread.OnTerminate event was never called (I already assigned it).
> Also, I search the source code of TThread in classeh.inc and found 
> that there was no calling of FOnTerminate nor OnTerminate
> Is it supposed to be a dummy place holder?
> I don't use Delphi any more. Is this behaviour the same as Delphi?
> Thanks in advance.

How did you test it? OnTerminate is called using Synchronize so if you 
use a command line program to test it you need to make sure to call 
CheckSynchronize otherwise you'll never see it being called. In a LCL 
program that should work without any further action.


More information about the fpc-pascal mailing list