Switched to using NS_WITH_SERVICE as per bug 5403

This commit is contained in:
vidur%netscape.com 1999-06-29 23:43:46 +00:00
parent 41d9c08f41
commit bb53422b38
2 changed files with 4 additions and 10 deletions

View File

@ -475,18 +475,15 @@ nsDOMImplementation::GetScriptObject(nsIScriptContext *aContext,
nsresult result = NS_OK;
if (nsnull == mScriptObject) {
nsIDOMScriptObjectFactory *factory;
NS_WITH_SERVICE(nsIDOMScriptObjectFactory, factory,
kDOMScriptObjectFactoryCID, &result);
result = nsServiceManager::GetService(kDOMScriptObjectFactoryCID,
kIDOMScriptObjectFactoryIID,
(nsISupports **)&factory);
if (NS_OK == result) {
nsIScriptGlobalObject *global = aContext->GetGlobalObject();
result = factory->NewScriptDOMImplementation(aContext, (nsISupports*)(nsIDOMDOMImplementation*)this,
global, &mScriptObject);
NS_RELEASE(global);
NS_RELEASE(factory);
}
}

View File

@ -475,18 +475,15 @@ nsDOMImplementation::GetScriptObject(nsIScriptContext *aContext,
nsresult result = NS_OK;
if (nsnull == mScriptObject) {
nsIDOMScriptObjectFactory *factory;
NS_WITH_SERVICE(nsIDOMScriptObjectFactory, factory,
kDOMScriptObjectFactoryCID, &result);
result = nsServiceManager::GetService(kDOMScriptObjectFactoryCID,
kIDOMScriptObjectFactoryIID,
(nsISupports **)&factory);
if (NS_OK == result) {
nsIScriptGlobalObject *global = aContext->GetGlobalObject();
result = factory->NewScriptDOMImplementation(aContext, (nsISupports*)(nsIDOMDOMImplementation*)this,
global, &mScriptObject);
NS_RELEASE(global);
NS_RELEASE(factory);
}
}