зеркало из https://github.com/mozilla/gecko-dev.git
bug #5403 Added code to properly release NetService and IOServices
This commit is contained in:
Родитель
23c3ae5f4c
Коммит
70bcedc4e3
|
@ -185,17 +185,13 @@ ImageNetContextSyncImpl::GetURL(ilIURL* aURL,
|
||||||
nsIURI* url = nsnull;
|
nsIURI* url = nsnull;
|
||||||
aURL->QueryInterface(kIURLIID, (void **)&url);
|
aURL->QueryInterface(kIURLIID, (void **)&url);
|
||||||
|
|
||||||
|
nsresult res;
|
||||||
|
|
||||||
// Get a network service interface which we'll use to create a stream
|
// Get a network service interface which we'll use to create a stream
|
||||||
#ifndef NECKO
|
#ifndef NECKO
|
||||||
nsINetService *service;
|
NS_WITH_SERVICE(nsINetService, service, kNetServiceCID, &res)
|
||||||
nsresult res = nsServiceManager::GetService(kNetServiceCID,
|
|
||||||
kINetServiceIID,
|
|
||||||
(nsISupports **)&service);
|
|
||||||
#else
|
#else
|
||||||
nsIIOService *service;
|
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &res);
|
||||||
nsresult res = nsServiceManager::GetService(kIOServiceCID,
|
|
||||||
kIIOServiceIID,
|
|
||||||
(nsISupports **)&service);
|
|
||||||
#endif // NECKO
|
#endif // NECKO
|
||||||
|
|
||||||
if (NS_SUCCEEDED(res)) {
|
if (NS_SUCCEEDED(res)) {
|
||||||
|
@ -267,8 +263,6 @@ ImageNetContextSyncImpl::GetURL(ilIURL* aURL,
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IF_RELEASE(stream);
|
NS_IF_RELEASE(stream);
|
||||||
NS_RELEASE(service);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
aReader->StreamAbort(-1);
|
aReader->StreamAbort(-1);
|
||||||
status = -1;
|
status = -1;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче