[fpc-pascal] Interface reference counting

Graeme Geldenhuys graemeg.lists at gmail.com
Thu Apr 2 14:09:43 CEST 2009

On Thu, Apr 2, 2009 at 1:46 PM, Felipe Monteiro de Carvalho
<felipemonteiro.carvalho at gmail.com> wrote:
> Hello,
> Just to be sure, when using an interface from COM, can I just ignore
> it and the compiler will release it when it's scope ends, or do I need
> to manually set the variable to nil?

When it goes out of scope it gets freed. But I do vaguely remember
something in the lines of you are not guaranteed when it gets freed.
But with my testing it gets freed pretty quickly.

I use interfaces for logging (entering & exiting procedures) and for
reseting the mouse cursor when a method exits.

  - Graeme -

fpGUI - a cross-platform Free Pascal GUI toolkit

More information about the fpc-pascal mailing list