mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 290247: fix 3 long-standing do_CreateInstanceFromCategory bugs:
- initialize mOuter so we don't always try to aggregate against a random stack pointer; - don't try to store through the oft-null mErrorPtr - set rv so that we actually check CreateInstanceByContractID's return r=bsmedberg, sr=darin, a=brendan
This commit is contained in:
parent
85ab4e49c5
commit
8aae1b4f86
@ -53,6 +53,7 @@ public:
|
||||
nsISupports *aOuter, nsresult *aErrorPtr)
|
||||
: mCategory(aCategory),
|
||||
mEntry(aEntry),
|
||||
mOuter(aOuter),
|
||||
mErrorPtr(aErrorPtr)
|
||||
{
|
||||
// nothing else to do;
|
||||
|
@ -197,16 +197,14 @@ nsCreateInstanceFromCategory::operator()(const nsIID& aIID, void** aInstancePtr)
|
||||
NS_GetComponentManager(getter_AddRefs(compMgr));
|
||||
if (!compMgr)
|
||||
return NS_ERROR_FAILURE;
|
||||
compMgr->CreateInstanceByContractID(value,
|
||||
mOuter,
|
||||
aIID,
|
||||
aInstancePtr);
|
||||
rv = compMgr->CreateInstanceByContractID(value, mOuter, aIID, aInstancePtr);
|
||||
if (NS_FAILED(rv)) {
|
||||
error:
|
||||
*aInstancePtr = 0;
|
||||
}
|
||||
|
||||
*mErrorPtr = rv;
|
||||
if (mErrorPtr)
|
||||
*mErrorPtr = rv;
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user