mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 334549: Fix for Coverty CID 179: assert instead try to handle being called twice. patch by Jon Smirl <jonsmirl@yahoo.com>, r=bsmedberg, sr=darin
This commit is contained in:
parent
4571423968
commit
5e855c68ad
@ -513,16 +513,6 @@ NS_InitXPCOM3(nsIServiceManager* *result,
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
// Create the Component/Service Manager
|
||||
nsComponentManagerImpl *compMgr = NULL;
|
||||
|
||||
if (nsComponentManagerImpl::gComponentManager == NULL)
|
||||
{
|
||||
compMgr = new nsComponentManagerImpl();
|
||||
if (compMgr == NULL)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(compMgr);
|
||||
|
||||
nsCOMPtr<nsIFile> xpcomLib;
|
||||
|
||||
PRBool value;
|
||||
@ -551,6 +541,14 @@ NS_InitXPCOM3(nsIServiceManager* *result,
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
|
||||
NS_ASSERTION(nsComponentManagerImpl::gComponentManager == NULL, "CompMgr not null at init");
|
||||
|
||||
// Create the Component/Service Manager
|
||||
nsComponentManagerImpl *compMgr = new nsComponentManagerImpl();
|
||||
if (compMgr == NULL)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(compMgr);
|
||||
|
||||
rv = compMgr->Init(staticComponents, componentCount);
|
||||
if (NS_FAILED(rv))
|
||||
{
|
||||
@ -566,7 +564,6 @@ NS_InitXPCOM3(nsIServiceManager* *result,
|
||||
|
||||
NS_ADDREF(*result = serviceManager);
|
||||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIMemory> memory;
|
||||
NS_GetMemoryManager(getter_AddRefs(memory));
|
||||
|
Loading…
Reference in New Issue
Block a user