[fpc-pascal] Memory leak on TFPGInterfacedObjectList

Joao Morais l at joaomorais.com.br
Tue Jan 28 01:11:28 CET 2014


Em 27/01/14 20:39, Marco van de Voort escreveu:
> In our previous episode, Joao Morais said:
>> Hello list. Whenever I add interfaced objects to a
>> TFPGInterfacedObjectList, those objects apparently add two references,
>> while release only one when the list is cleaned or destroyed.
> v1 reference will only be freed at the end, and also counts as one. Still,
> that doesn't explain the memleak, but to test it, try to nest it within a
> function instead of with globals.
>
The original leak was deep inside a project of mine. Anyway I nested the 
vars and the code inside a function (if I understood you correctly): 
same output, same problem. Btw I changed the generic list to 
TInterfaceList (test and my project) and the leak was gone.

Last but not least: 2.6.3 of a couple of weeks ago,  Mac OS X.




More information about the fpc-pascal mailing list