[Lazarus] Memory leak in TThread class

waldo kitty wkitty42 at windstream.net
Tue Oct 5 17:26:33 CEST 2010


On 10/5/2010 08:40, Luca Olivetti wrote:
> En/na silvioprog ha escrit:
>> Hi folks,
>>
>> I detected a small leak in the TThread class. I made a simple test and I
>> sending in attached (or http://pastebin.com/aWNuHyDQ). To reproduce the leak,
>> just open and close the demo.
>
> That's probably because the thread has no chance to run (you create it suspended
> and never resume it).
> If you create it with suspended=false or resume it right after creating it,
> there's no leak.

if it has no chance to run, it should not allocate the memory...

if it allocates the memory during a create-suspended, it should un-allocate that 
memory during a destroy-suspended...

in other words, it should not matter if the thread is suspended or not... if it 
allocates memory during creation it should deallocate that memory during 
destruction...




More information about the Lazarus mailing list