<HTML><HEAD>
<META content="text/html; charset=ISO-8859-1" http-equiv=Content-Type></HEAD>
<BODY dir=ltr bgColor=#ffffff text=#000000>
<DIV dir=ltr>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial'; COLOR: #000000">
<DIV>The thing is that we have weak references for COM – standard pointer
;-)</DIV>
<DIV>ARC without optional weak pointers leads to guaranteed memory leak.</DIV>
<DIV> </DIV>
<DIV>Simple example:</DIV>
<DIV> </DIV>
<DIV>Parent calls with children, and child with pointer to parent. If the
pointer to parent is not weak, the objects will never be freed.</DIV>
<DIV>In COM we work around that with non interface pointers, (effectively weak
pointers ;-) ).</DIV>
<DIV> </DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial'; COLOR: #000000">With best
regards,<BR>Boian
Mitov<BR><BR>-------------------------------------------------------<BR>Mitov
Software<BR>www.mitov.com<BR>-------------------------------------------------------</DIV>
<DIV
style='FONT-SIZE: small; TEXT-DECORATION: none; FONT-FAMILY: "Calibri"; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; DISPLAY: inline'>
<DIV style="FONT: 10pt tahoma">
<DIV> </DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=hinstance@yandex.ru
href="mailto:hinstance@yandex.ru">hinstance</A> </DIV>
<DIV><B>Sent:</B> Monday, September 22, 2014 1:17 PM</DIV>
<DIV><B>To:</B> <A title=fpc-devel@lists.freepascal.org
href="mailto:fpc-devel@lists.freepascal.org">FPC developers' list</A> </DIV>
<DIV><B>Subject:</B> Re: [fpc-devel] Suggestion: reference counted
objects</DIV></DIV></DIV>
<DIV> </DIV></DIV>
<DIV
style='FONT-SIZE: small; TEXT-DECORATION: none; FONT-FAMILY: "Calibri"; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; DISPLAY: inline'>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 <B>how many times</B> ARC class was proposed before, I lost
hope that it will be ever implemented at all quite a while ago
<BR></DIV></DIV></DIV></BODY></HTML>