On 07/10/2014 08:03 AM, Benjamin Smedberg wrote: > On 7/10/2014 10:46 AM, Daniel Holbert wrote: >> Shouldn't the refcounting still be on the concrete classes? > Why? > > This happens for example with nsRunnable: nsRunnable does the > refcounting, and all the derivations of nsRunnable only have to worry > about overriding Run because there's a virtual destructor.
Oh, good point -- the refcounting can go on an abstract base class, if that base class has a virtual destructor. So, I retract my "if your class is abstract, then it shouldn't have AddRef/Release implementations to begin with" statement from the initial email on this thread. (I think the rest of my "BUT WHAT IF I NEED SUBCLASSES" section from that message still applies, but just with the abstract/concrete distinction removed.) ~Daniel _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform