From 808c368d055918e43886f5847000acd94a5b76cd Mon Sep 17 00:00:00 2001 From: "locka%iol.ie" Date: Fri, 7 Sep 2001 18:05:50 +0000 Subject: [PATCH] Fix for fallout in embedding from component/service manager merge. b=98721 r=ccarlen@netscape.com sr=blizzard@mozilla.org --- embedding/base/nsEmbedAPI.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/embedding/base/nsEmbedAPI.cpp b/embedding/base/nsEmbedAPI.cpp index 933ac39817f..0f7bdd45e7d 100644 --- a/embedding/base/nsEmbedAPI.cpp +++ b/embedding/base/nsEmbedAPI.cpp @@ -86,8 +86,6 @@ nsresult NS_InitEmbedding(nsILocalFile *mozBinDirectory, { // Initialise XPCOM NS_InitXPCOM2(&sServiceManager, mozBinDirectory, appFileLocProvider); - if (!sServiceManager) - return NS_ERROR_NULL_POINTER; #ifdef HACK_AROUND_NONREENTRANT_INITXPCOM sXPCOMInitializedFlag = PR_TRUE; @@ -132,9 +130,7 @@ nsresult NS_InitEmbedding(nsILocalFile *mozBinDirectory, #ifdef HACK_AROUND_THREADING_ISSUES // XXX force certain objects to be created on the main thread nsCOMPtr sBundleService; - rv = sServiceManager->GetService(NS_STRINGBUNDLE_CONTRACTID, - nsIStringBundleService::GetIID(), - getter_AddRefs(sBundleService)); + sBundleService = do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv); if (NS_SUCCEEDED(rv)) { nsCOMPtr stringBundle; @@ -146,9 +142,7 @@ nsresult NS_InitEmbedding(nsILocalFile *mozBinDirectory, // Init the chrome registry. nsCOMPtr chromeReg; - rv = sServiceManager->GetService("@mozilla.org/chrome/chrome-registry;1", - nsIChromeRegistry::GetIID(), - getter_AddRefs(chromeReg)); + chromeReg = do_GetService("@mozilla.org/chrome/chrome-registry;1", &rv); if (chromeReg) { // Ignore the return value here. If chrome is already initialized @@ -169,7 +163,7 @@ nsresult NS_TermEmbedding() } sInitCounter = 0; - NS_RELEASE(sServiceManager); + NS_IF_RELEASE(sServiceManager); // Terminate XPCOM & cleanup #ifndef HACK_AROUND_NONREENTRANT_INITXPCOM