[fpc-pascal] A serious Memleak using delegates/implements (was: Delegate Interface class does not seem to be referenced counted)

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Thu Oct 6 12:36:33 CEST 2016

On 2016-10-06 02:49, Marcos Douglas wrote:
> I understand you, but reference counting help us to write a better
> code, more object-oriented.

That's got nothing to do with reference counting functionality. I use
object-oriented coding practices all the time, but I don't need
reference counting for that.

> I'm using decorator pattern. No problem with it, but delegates makes
> me write less code and the design is awesome.

So, nothing stops you from using interface delegates with CORBA style
interfaces. See the example code I just posted, where I converted the
original example to use CORBA style interfaces instead.

I'm a huge believer and user of design patterns, and most of them I've
implemented using Interfaces. Nothing there tells me I must use COM
style interfaces.

> For me, it's a bug. Sorry.

That I agree with. There seems to be a COM reference counted bug.


fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal

My public PGP key:  http://tinyurl.com/graeme-pgp

More information about the fpc-pascal mailing list