Open Bug 1008348 Opened 12 years ago Updated 3 years ago

Make mRefCnt private instead of protected

Categories

(Core :: XPCOM, defect)

defect

Tracking

()

People

(Reporter: mccr8, Unassigned)

References

Details

I don't see any good reason why a child class should be accessing mRefCnt directly in most cases. Doing this will let us catch when somebody does NS_IMPL_ISUPPORTS() when they should be using NS_IMPL_ISUPPORTS_INHERITED(). It seems to mostly work, aside from a bunch of places that want to print out the refcount. It does produce a monstrous amount of error spew when you get it wrong, though.
Depends on: 1008400
In some cases we want to check whether object is purple. But I guess the base class can then just expose some helper methods.
Depends on: 1008404
That wasn't actually a problem.
This is another thing you might be interested in looking into, bjacob. I have a WIP around somewhere. There are some classes that access the refcount directly, some to reimplement AddRef()/Release(), some to just print out the ref count. So you'd probably need some kind of escape hatch.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.