Adding null checks. patch by timeless, r=me

This commit is contained in:
dougt%netscape.com 2002-09-12 19:35:49 +00:00
Родитель 9de5f0f245
Коммит 6c6a5e01a8
1 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -715,7 +715,9 @@ nsresult NS_COM NS_ShutdownXPCOM(nsIServiceManager* servMgr)
NS_IF_RELEASE(servMgr);
// Shutdown global servicemanager
if (nsComponentManagerImpl::gComponentManager) {
nsComponentManagerImpl::gComponentManager->FreeServices();
}
nsServiceManager::ShutdownGlobalServiceManager(nsnull);
if (currentQ) {
@ -742,8 +744,11 @@ nsresult NS_COM NS_ShutdownXPCOM(nsIServiceManager* servMgr)
// Shutdown xpcom. This will release all loaders and cause others holding
// a refcount to the component manager to release it.
if (nsComponentManagerImpl::gComponentManager) {
rv = (nsComponentManagerImpl::gComponentManager)->Shutdown();
NS_ASSERTION(NS_SUCCEEDED(rv), "Component Manager shutdown failed.");
} else
NS_WARNING("Component Manager was never created ...");
// Release our own singletons
// Do this _after_ shutting down the component manager, because the