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
parent 9791154211
commit 430b684e9c
2 changed files with 12 additions and 0 deletions

View File

@ -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.
{

View File

@ -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;