Interfaces support reference counting.

ISomeObject = interface

TSomeObject = class(TinterfacedObject, ISomeObject)

var
 MyObj: ISomeObject;

Regards,

On 02 Feb 11, at 15:22 , Bo Berglund wrote:

> Will this create a memory leak or will FPC fnd by reference counting
> that nothing references the object memory and dispose of it?

> What happens here where the local variable MyObj gets out of scope,
> again with the reference to object memory disappearing?
> Memory leak or object destruction?

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to