draft proposal for ref counting in D

Walter Bright newshound2 at digitalmars.com
Wed Oct 9 19:24:56 PDT 2013


Michel Fortin wrote:
Le 25-juin-2013 à 17:00, Walter Bright  a écrit :

 > 6. If a class or struct contains RC fields, calls to Release() for those 
fields will
 > be added to the destructor, and a destructor will be created if one doesn't 
exist already.

Another thing to note that the above is dangerous if the destructor is called 
from the GC and RC objects are allocated from GC memory. Referenced objects 
might already have been destroyed and you'll be calling Release() on them. This 
will happen when the GC releases a cycle.



More information about the Digitalmars-d mailing list