зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
4a33d14311
Коммит
d92ea91a17
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче