nsCOMPtr can be constructed with const char* and nsID

RESOLVED FIXED

Status

()

RESOLVED FIXED
13 years ago
13 years ago

People

(Reporter: jag+mozilla, Assigned: jag+mozilla)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

13 years ago
See also bug 317911.

// this constructs a nsGetServiceByContractID temporary
nsCOMPtr<nsIFoo> foo("foo");

It may seem like a nifty shortcut for do_GetService(), but I don't think we should allow it. Similar for nsID and nsGetServiceByCID. Patch coming up.
(Assignee)

Comment 1

13 years ago
Created attachment 209088 [details] [diff] [review]
Make nsGetServiceBy{CID,ContractID}'s constructors explicit
Attachment #209088 - Flags: superreview?(dbaron)
Attachment #209088 - Flags: review?(benjamin)

Updated

13 years ago
Attachment #209088 - Flags: review?(benjamin) → review+
(Assignee)

Comment 2

13 years ago
Checking in nsCOMPtr.h;
/cvsroot/mozilla/xpcom/glue/nsCOMPtr.h,v  <--  nsCOMPtr.h
new revision: 1.122; previous revision: 1.121
done
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.