[fpc-pascal] A serious Memleak using delegates/implements (was: Delegate Interface class does not seem to be referenced counted)
tony.whyman at mccallumwhyman.com
Fri Oct 7 12:30:42 CEST 2016
On 07/10/16 11:08, stdreamer wrote:
> I see no rabbit hole or any other problem in the code posted so far
> except perhaps lack of proper clean up which might be intentional.
A Rabbit Hole is not the same as a bug and my point is not that
"interface delegation" does not work, it is that it is counter-intuitive
and poorly documented to the point of undocumented. Your introduction of
TContainedObject is just another example of missing information.
Reference Counted interfaces must be easy to use and should not require
the user to have advanced knowledge of how they work. If that last point
is true then all the that nay-sayers that argue against reference
counted interfaces have their point made for them.
A Rabbit Hole comes from Alice in Wonderland and when you fall down it
you are not just chasing a White Rabbit, you have found yourself in
another universe that has a different logic to your own. Reference
counting with Interface Delegation seems to have a different logic to
that of normal reference counted interfaces - and that is why you feel
that you have fallen down a Rabbit Hole as soon as you start trying to
“But I don’t want to go among mad people," Alice remarked.
"Oh, you can’t help that," said the Cat: "we’re all mad here. I’m mad.
"How do you know I’m mad?" said Alice.
"You must be," said the Cat, "or you wouldn’t have come here.”
― Lewis Carroll, Alice in Wonderland
More information about the fpc-pascal