Closed Bug 461086 Opened 17 years ago Closed 17 years ago

conversion from RawPtrType to already_AddRefed<RawPtrType> should be explicit

Categories

(Core :: XPCOM, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 345225

People

(Reporter: karlt, Unassigned)

Details

Automatically converting from a type that hasn't been AddRefed to one that says it has been AddRefed seems wrong. Unfortunately there seem to be a large number of already_AddRefed<T> getT() { T *ret = new T(); NS_IF_ADDREF(ret); return ret; } Something like the following would be nice: already_AddRefed<T> getT() { T *ret = new T(); return do_AddRef(ret); }
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.