mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-14 10:43:24 +00:00
Switched to using NS_WITH_SERVICE as per bug 5403
This commit is contained in:
parent
41d9c08f41
commit
bb53422b38
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user