[Lazarus] IUnknown and reference counting

Joao Morais jcmoraisjr at gmail.com
Thu Mar 21 21:19:08 CET 2013


2013/3/21 Graeme Geldenhuys <graeme at geldenhuys.co.uk>:
> On 2013-03-21 12:55, Kostas Michalopoulos wrote:
>> properties. That could save a lot of headaches i have with my 3D world
>> editor's lightmap generation (currently there is some wrong memory
>> deallocation somewhere that crashes the editor in partial lightmap
>
> Don't be fooled to think Interfaces is the answer to all memory issues.
> The use of Interfaces is an "advanced topic". There are many pitfalls
> you need to look out for when using them.

- Memory leak with circular references
- Some useless inc/dec if you don't use const parameters
- Premature destruction when creating within a const parameter and
using it (one inc, one dec) before store the reference permanently
- what more? =)

Joao Morais




More information about the Lazarus mailing list