Releasing servMgr if one is passed in to match NS_InitXPCOM()

This commit is contained in:
dp%netscape.com 1999-09-24 06:26:17 +00:00
parent 54e572a820
commit 96c1197169

View File

@ -435,7 +435,11 @@ nsresult NS_COM NS_InitXPCOM(nsIServiceManager* *result,
nsresult NS_COM NS_ShutdownXPCOM(nsIServiceManager* servMgr)
{
nsrefcnt cnt;
NS_RELEASE2(nsServiceManager::mGlobalServiceManager, cnt);
// We may have AddRef'd for the caller of NS_InitXPCOM, so release it
// here again:
NS_IF_RELEASE(servMgr);
NS_RELEASE2(nsServiceManager::mGlobalServiceManager, cnt);
NS_ASSERTION(cnt == 0, "Service Manager being held past XPCOM shutdown.");
// Finally, release the component manager last because it unloads the