Closed
Bug 124628
Opened 23 years ago
Closed 21 years ago
Allow an nsresult argument to NS_NEWXPCOM
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
WONTFIX
Future
People
(Reporter: sicking, Assigned: dougt)
References
()
Details
I've a couple of times needed to do initialization in the ctor that can fail,
for example instancing member-vars. To do this i figured i could add an
|nsresult* rv| argument to the ctor and return the errorcode there.
However if I can no longer use the NS_NEWXPCOM to instaciate the class and so I
loose refcnt tracing.
So I was thinking that we could maybe add a NS_NEWXPCOM_WITH_RESULT macro that
allows a nsresult* argument to the ctor. I'd happily produce a patch for this if
you think it's a good idea.
The alternative is to add an Init-function to the class and call that right
after instancing, however this adds uglyness to the implementation since it
breaks up the ctor into two functions
Assignee | ||
Comment 1•23 years ago
|
||
How about a macro which is NS_NEWXPCOM_INIT which takes a init function name?
Attach a patch, please.
Target Milestone: --- → mozilla1.2
Reporter | ||
Comment 2•23 years ago
|
||
but that wouldn't solve the main problem, that i have to split up the
initialization in two functions; ctor and Init
Assignee | ||
Comment 3•23 years ago
|
||
attach a patch which will better describe what you want to do.
Assignee | ||
Updated•22 years ago
|
Target Milestone: mozilla1.2alpha → Future
Reporter | ||
Comment 4•21 years ago
|
||
nevermind I don't think this is really a good idea any more
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•