On Wed, 12 Apr 2017, nore...@z505.com wrote:
On 2017-04-12 05:03, LacaK wrote:
Yes, example should be adjusted. Please report bug to not forget.
Thanks
-Laco.
It is not a bug, I just wanted to clarify the magic going on behind the
scenes - which, is "ownership".
That's all I needed to know.
The key to seeing this trick/magic is in the Create function where you
pass in the C (connection) as the owner.
But on my cell phone I didn't really see this, and, it's not always
obvious.. hence my gripe.
In a way, this is a form of garbage collection or RAII sort of. And
reduces the obnoxious free's required in non garbage collected
programming languages... So it's a nice feature/trick to have ownership.
It's one of the reasons I descend most of my classes from TComponent;
the cleanup is then automatic...
Michael.
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal