[fpc-pascal] Usage of TInterfacedObject. Automatic release?

Luiz Americo Pereira Camara pascalive at bol.com.br
Sat May 26 20:58:07 CEST 2007


Joao Morais wrote:
> Luiz Americo Pereira Camara wrote:
>
>> Unfortunately in the original code Manager is already an interface 
>> but still leaking memory. It seems that is a more complex bug.
>
> If you have two or more interfaces whose members point each other in a 
> circular reference scenario, without using weak reference, you will 
> have memory leakage.

Thanks.
I don't have any experience with interfaces but is quite possible that 
this is the case. The component i'm porting is the TVirtualTreeView that 
uses extensively interfaces/COM and this part of the code is a bit complex.

Anyway, calling manually _Release avoid the leak and i will stay with it 
for now (I hope did not break anything).

Luiz




More information about the fpc-pascal mailing list