Closed Bug 1672556 Opened 4 years ago Closed 4 years ago

NS_INLINE_DECL_REFCOUNTING_INHERITED should introduce a declaration into the containing class regardless whether refcount logging is enabled

Categories

(Core :: XPCOM, defect, P1)

defect

Tracking

()

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: Waldo, Assigned: Waldo)

References

Details

Attachments

(1 file)

The macro currently introduces an inline declaration that calls Super::AddRef/Release when refcount logging is enabled. But when it's not it expands to nothing -- and while that makes conceptual sense, it also means AddRef and Release in the containing class, if it inherits from multiple base classes with refcounting, are ambiguous.

I ran into this in bug 1660555 comment 23, and https://treeherder.mozilla.org/#/jobs?repo=try&revision=1674f0f218b0e390dc629e7482a7579062dec1df verifies this patch works correctly when (in the "Make |AbortFollower| actually inherit from |nsISupports|." rev, see the final hunk of it) a containing class that has such multiple inheritance is present in the tree.

Blocks: 1660555
Pushed by jwalden@mit.edu: https://hg.mozilla.org/integration/autoland/rev/aae81b077b39 |NS_INLINE_DECL_REFCOUNTING_INHERITED(Class, Super)| should |using| in |Super|'s |AddRef| and |Release| functions, so that |Class::AddRef| and |Class::Release| are unambiguous whether or not refcount logging is in effect. r=sg
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: