[fpc-pascal] TThread.OnTerminate never called

Dennis dec12 at avidsoft.com.hk
Sat Apr 27 05:21:59 CEST 2019



Sven Barth via fpc-pascal wrote:
> 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.
>
I am using the debugger to break on the Event assigned to OnTerminate.  
That breakpoint was never reached.
I am using the FpDebug internal Dwart-debugger (beta)
Can you tell me what the code of calling synchronize(OnTerminate) is?  I 
cannot find it in the FPC source.
Dennis



More information about the fpc-pascal mailing list