[fpc-devel] Suggestion: reference counted objects

Boian Mitov mitov at mitov.com
Mon Sep 22 22:57:15 CEST 2014


The thing is that we have weak references for COM – standard pointer ;-)
ARC without optional weak pointers leads to guaranteed memory leak.

Simple example:

Parent calls with children, and child with pointer to parent. If the pointer to parent is not weak, the objects will never be freed.
In COM we work around that with non interface pointers, (effectively weak pointers ;-) ).

With best regards,
Boian Mitov

-------------------------------------------------------
Mitov Software
www.mitov.com
-------------------------------------------------------

From: hinstance 
Sent: Monday, September 22, 2014 1:17 PM
To: FPC developers' list 
Subject: Re: [fpc-devel] Suggestion: reference counted objects

I am not even sure if weak reference feature is necessary. We don't have weak references for COM interfaces, and it still works so far. Well, of course, if we had weak references as well, it would be a useful feature perhaps, but considering just how many times ARC class was proposed before, I lost hope that it will be ever implemented at all quite a while ago 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20140922/b88a3a23/attachment.html>


More information about the fpc-devel mailing list