зеркало из https://github.com/mozilla/pjs.git
Switched to using NS_WITH_SERVICE as per bug 5403
This commit is contained in:
Родитель
bcfaa5d81e
Коммит
88a75ad2dc
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче