Open Bug 1573996 Opened 5 years ago Updated 2 years ago

Invalid use of RefPtr for nsISupport base class.

Categories

(Core :: XPCOM, defect)

defect

Tracking

()

People

(Reporter: jya, Unassigned)

References

Details

I noticed this while flying over the code on an unrelated issue:
https://searchfox.org/mozilla-central/rev/3366c3d24f1c3818df37ec0818833bf085e41a53/dom/media/systemservices/MediaUtils.h#287

nsI* object is stored in nsISupport

Actually, there are over 500 similar misuse code-wise, so I'll do a quick tree-wise find/replace.

Component: Audio/Video → XPCOM

I think the difference between the two is that nsCOMPtr<> checks the canonicity of the nsISupports pointer in debug builds. At least at one point, there was one place in XPConnect that was deliberately using a RefPtr<> because it was holding a non-canonical pointer, but that should be quite rare, or possibly non-existent. But it'll be worth double checking places in js/xpconnect that get changed to see if there are comments about it.

See Also: → 756640
Assignee: jya-moz → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.