fixes bug 285991 "leak loading site from HTTPS" r=biesi sr=dbaron

This commit is contained in:
darin%meer.net 2005-04-06 01:35:06 +00:00
Родитель 130fb0d326
Коммит ed46df60ea
2 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -1529,6 +1529,13 @@ nsSocketTransport::OnSocketDetached(PRFileDesc *fd)
mOutput.OnSocketReady(mCondition);
}
// break any potential reference cycle between the security info object
// and ourselves by resetting its notification callbacks object. see
// bug 285991 for details.
nsCOMPtr<nsISSLSocketControl> secCtrl = do_QueryInterface(mSecInfo);
if (secCtrl)
secCtrl->SetNotificationCallbacks(nsnull);
// finally, release our reference to the socket (must do this within
// the transport lock) possibly closing the socket.
{

Просмотреть файл

@ -257,6 +257,11 @@ nsNSSSocketInfo::GetNotificationCallbacks(nsIInterfaceRequestor** aCallbacks)
NS_IMETHODIMP
nsNSSSocketInfo::SetNotificationCallbacks(nsIInterfaceRequestor* aCallbacks)
{
if (!aCallbacks) {
mCallbacks = nsnull;
return NS_OK;
}
nsCOMPtr<nsIProxyObjectManager> proxyman(do_GetService(NS_XPCOMPROXY_CONTRACTID));
if (!proxyman)
return NS_ERROR_FAILURE;