draft proposal for ref counting in D

Walter Bright newshound2 at digitalmars.com
Wed Oct 9 19:17:39 PDT 2013


Rainer Schuetze wrote:

On 28.06.2013 09:07, Walter Bright wrote:
 > Will add to proposal.
 >
 > On 6/27/2013 11:27 PM, Rainer Schuetze wrote:
 >> On 25.06.2013 23:00, Walter Bright wrote:
 >>> 4. Null checks are done before calling any AddRef() or Release().
 >>
 >> Here is another nitpick that needs to be addressed: As mentioned in
 >> the implementation of ComObject invariants (and out contracts) must
 >> not be called when returning from Release, if it is ok to actually
 >> delete the object.
 >>


Sorry to produce these drop by drop, but while writing the last mail, I noticed 
another issue to think about:

What happens if the class also implements interfaces? A reference of the 
interface type must do reference counting as well. So the interface must also 
define AddRef and Release. This is currently true for COM-interfaces derived 
from IUnknown, but not for other interfaces.



More information about the Digitalmars-d mailing list