[fpc-pascal] Question: Is there a global callback, when a thread gets terminated?

Martin Frb lazarus at mfriebe.de
Sun Feb 10 14:40:35 CET 2019


On 08/02/2019 10:09, Michael Schnell wrote:
>> There are no "siblings".
>>
>> The use case here would be LazLogger. User code can call a function "Debugln"
>> this calls a method on a global object.
>> The object provides storage for log-level (by name), and indentation, and
>> others.
>   
> So the logger software could check a Thradvar (I *suppose* they are initiated with Zero) and create or use an internal object the self of which is stored in the Threadvar and with that having an instance for any thread that calls "Debugln"
>
Yes, but how do I get notified, when the thread is gone, and I can free 
the memory (of the object that was created)?



More information about the fpc-pascal mailing list