Fix for fallout in embedding from component/service manager merge. b=98721 r=ccarlen@netscape.com sr=blizzard@mozilla.org

This commit is contained in:
locka%iol.ie 2001-09-07 18:05:50 +00:00
Родитель 09a0fb0d37
Коммит 808c368d05
1 изменённых файлов: 3 добавлений и 9 удалений

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

@ -86,8 +86,6 @@ nsresult NS_InitEmbedding(nsILocalFile *mozBinDirectory,
{ {
// Initialise XPCOM // Initialise XPCOM
NS_InitXPCOM2(&sServiceManager, mozBinDirectory, appFileLocProvider); NS_InitXPCOM2(&sServiceManager, mozBinDirectory, appFileLocProvider);
if (!sServiceManager)
return NS_ERROR_NULL_POINTER;
#ifdef HACK_AROUND_NONREENTRANT_INITXPCOM #ifdef HACK_AROUND_NONREENTRANT_INITXPCOM
sXPCOMInitializedFlag = PR_TRUE; sXPCOMInitializedFlag = PR_TRUE;
@ -132,9 +130,7 @@ nsresult NS_InitEmbedding(nsILocalFile *mozBinDirectory,
#ifdef HACK_AROUND_THREADING_ISSUES #ifdef HACK_AROUND_THREADING_ISSUES
// XXX force certain objects to be created on the main thread // XXX force certain objects to be created on the main thread
nsCOMPtr<nsIStringBundleService> sBundleService; nsCOMPtr<nsIStringBundleService> sBundleService;
rv = sServiceManager->GetService(NS_STRINGBUNDLE_CONTRACTID, sBundleService = do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
nsIStringBundleService::GetIID(),
getter_AddRefs(sBundleService));
if (NS_SUCCEEDED(rv)) if (NS_SUCCEEDED(rv))
{ {
nsCOMPtr<nsIStringBundle> stringBundle; nsCOMPtr<nsIStringBundle> stringBundle;
@ -146,9 +142,7 @@ nsresult NS_InitEmbedding(nsILocalFile *mozBinDirectory,
// Init the chrome registry. // Init the chrome registry.
nsCOMPtr<nsIChromeRegistry> chromeReg; nsCOMPtr<nsIChromeRegistry> chromeReg;
rv = sServiceManager->GetService("@mozilla.org/chrome/chrome-registry;1", chromeReg = do_GetService("@mozilla.org/chrome/chrome-registry;1", &rv);
nsIChromeRegistry::GetIID(),
getter_AddRefs(chromeReg));
if (chromeReg) if (chromeReg)
{ {
// Ignore the return value here. If chrome is already initialized // Ignore the return value here. If chrome is already initialized
@ -169,7 +163,7 @@ nsresult NS_TermEmbedding()
} }
sInitCounter = 0; sInitCounter = 0;
NS_RELEASE(sServiceManager); NS_IF_RELEASE(sServiceManager);
// Terminate XPCOM & cleanup // Terminate XPCOM & cleanup
#ifndef HACK_AROUND_NONREENTRANT_INITXPCOM #ifndef HACK_AROUND_NONREENTRANT_INITXPCOM