[fpc-pascal] Specifying a Interface type via $Interfaces

Joao Morais post at joaomorais.com.br
Fri Oct 12 23:37:09 CEST 2007


Dean Zobec wrote:
>> As for reference counting - that just means that as soon as the
>> reference count for an Interfaces reaches zero, it gets automatically
>> freed?
> yes, though you have to pay much attention to memory leaks and
> possible problems when dealing a lot with interfaces, memory leaks
> should be monitored closely.

An special attention with circular references, ie, one interface whose 
instance holds a reference to another interface whose instance ... holds 
a reference to the first one. The result is an island of leaked objects. 
There are afaik three ways to solve this problem: garbage collection, an 
algorithm to detect the island or one weak reference in order to break 
the chain.

--
Joao Morais




More information about the fpc-pascal mailing list