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

Marcos Douglas md at delfire.net
Thu Oct 6 16:41:08 CEST 2016

On Thu, Oct 6, 2016 at 7:36 AM, Graeme Geldenhuys
<mailinglists at geldenhuys.co.uk> wrote:
> 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.

OOP, for me, It is closer to functional programming.
You should to code more declarative and less imperative.
Declare a variable; Create; try-finally; using line-by-line; call
Free... that is imperative, Procedural and not about OOP.

>> 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 saw. But I can't use like that, as I explained above. Sorry... but thanks.

> 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.

The COM and CORBA names, are both wrong.
When you say COM, everybody thinks on Windows... that sad.

IMHO, interfaces with reference-counting is useful to write better
code, less imperative and using a design more closer to functional.

Best regards,
Marcos Douglas

More information about the fpc-pascal mailing list