clear out the result in |do_CreateInstance| on error. r=pinkerton

This commit is contained in:
scc%netscape.com 1999-11-22 23:01:35 +00:00
parent f52b509c55
commit 059d310964

View File

@ -100,6 +100,8 @@ nsresult
nsCreateInstanceByCID::operator()( const nsIID& aIID, void** aInstancePtr ) const
{
nsresult status = nsComponentManager::CreateInstance(mCID, mOuter, aIID, aInstancePtr);
if ( !NS_SUCCEEDED(status) )
*aInstancePtr = 0;
if ( mErrorPtr )
*mErrorPtr = status;
@ -111,7 +113,10 @@ nsCreateInstanceByProgID::operator()( const nsIID& aIID, void** aInstancePtr ) c
{
nsresult status;
if ( mProgID )
status = nsComponentManager::CreateInstance(mProgID, mOuter, aIID, aInstancePtr);
{
if ( !NS_SUCCEEDED(status = nsComponentManager::CreateInstance(mProgID, mOuter, aIID, aInstancePtr)) )
*aInstancePtr = 0;
}
else
status = NS_ERROR_NULL_POINTER;