mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
(r=valeski) Fix for new bloat (leaking HTTPChannels) that was introduced yesterday
This commit is contained in:
parent
46665376d1
commit
1b0f903b3f
@ -1842,6 +1842,7 @@ NS_IMETHODIMP
|
|||||||
nsSocketTransport::SetNotificationCallbacks(nsIInterfaceRequestor* aNotificationCallbacks)
|
nsSocketTransport::SetNotificationCallbacks(nsIInterfaceRequestor* aNotificationCallbacks)
|
||||||
{
|
{
|
||||||
mCallbacks = aNotificationCallbacks;
|
mCallbacks = aNotificationCallbacks;
|
||||||
|
mEventSink = 0;
|
||||||
|
|
||||||
// Get a nsIProgressEventSink so that we can fire status/progress on it-
|
// Get a nsIProgressEventSink so that we can fire status/progress on it-
|
||||||
if (mCallbacks) {
|
if (mCallbacks) {
|
||||||
@ -1852,8 +1853,7 @@ nsSocketTransport::SetNotificationCallbacks(nsIInterfaceRequestor* aNotification
|
|||||||
// Now generate a proxied event sink-
|
// Now generate a proxied event sink-
|
||||||
NS_WITH_SERVICE(nsIProxyObjectManager,
|
NS_WITH_SERVICE(nsIProxyObjectManager,
|
||||||
proxyMgr, kProxyObjectManagerCID, &rv);
|
proxyMgr, kProxyObjectManagerCID, &rv);
|
||||||
if (NS_SUCCEEDED(rv))
|
if (NS_SUCCEEDED(rv)) {
|
||||||
{
|
|
||||||
rv = proxyMgr->GetProxyObject(NS_UI_THREAD_EVENTQ, // primordial thread - should change?
|
rv = proxyMgr->GetProxyObject(NS_UI_THREAD_EVENTQ, // primordial thread - should change?
|
||||||
NS_GET_IID(nsIProgressEventSink),
|
NS_GET_IID(nsIProgressEventSink),
|
||||||
sink,
|
sink,
|
||||||
|
@ -504,6 +504,13 @@ nsresult nsHTTPHandler::ReleaseTransport(nsIChannel* i_pTrans)
|
|||||||
("nsHTTPHandler::ReleaseTransport."
|
("nsHTTPHandler::ReleaseTransport."
|
||||||
"\tReleasing socket transport %x.\n",
|
"\tReleasing socket transport %x.\n",
|
||||||
i_pTrans));
|
i_pTrans));
|
||||||
|
//
|
||||||
|
// Clear the EventSinkGetter for the transport... This breaks the
|
||||||
|
// circular reference between the HTTPChannel which holds a reference
|
||||||
|
// to the transport and the transport which references the HTTPChannel
|
||||||
|
// through the event sink...
|
||||||
|
//
|
||||||
|
rv = i_pTrans->SetNotificationCallbacks(nsnull);
|
||||||
|
|
||||||
rv = mTransportList->RemoveElement(i_pTrans);
|
rv = mTransportList->RemoveElement(i_pTrans);
|
||||||
NS_ASSERTION(NS_SUCCEEDED(rv), "Transport not in table...");
|
NS_ASSERTION(NS_SUCCEEDED(rv), "Transport not in table...");
|
||||||
|
Loading…
Reference in New Issue
Block a user