Fixed bug in ReleaseServcie that was recreating the service manager during shutdown

This commit is contained in:
kipp%netscape.com 1999-09-30 21:40:27 +00:00
Родитель 4f9c341b0c
Коммит a1f617e75c
1 изменённых файлов: 11 добавлений и 6 удалений

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

@ -497,10 +497,14 @@ nsresult
nsServiceManager::ReleaseService(const char* aProgID, nsISupports* service,
nsIShutdownListener* shutdownListener)
{
nsIServiceManager* mgr;
nsresult rv = GetGlobalServiceManager(&mgr);
if (NS_FAILED(rv)) return rv;
// Don't create the global service manager here because we might
// be shutting down, and releasing all the services in its
// destructor
nsIServiceManager* mgr = mGlobalServiceManager;
if (mgr) {
return mgr->ReleaseService(aProgID, service, shutdownListener);
}
return NS_OK;
}
nsresult
@ -515,8 +519,9 @@ nsServiceManager::RegisterService(const char* aProgID, nsISupports* aService)
nsresult
nsServiceManager::UnregisterService(const char* aProgID)
{
// Don't create the global service manager here because we might be shutting
// down, and releasing all the services in its destructor
// Don't create the global service manager here because we might
// be shutting down, and releasing all the services in its
// destructor
if (mGlobalServiceManager)
return mGlobalServiceManager->UnregisterService(aProgID);
return NS_OK;