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)
|
||||
{
|
||||
mCallbacks = aNotificationCallbacks;
|
||||
mEventSink = 0;
|
||||
|
||||
// Get a nsIProgressEventSink so that we can fire status/progress on it-
|
||||
if (mCallbacks) {
|
||||
@ -1852,8 +1853,7 @@ nsSocketTransport::SetNotificationCallbacks(nsIInterfaceRequestor* aNotification
|
||||
// Now generate a proxied event sink-
|
||||
NS_WITH_SERVICE(nsIProxyObjectManager,
|
||||
proxyMgr, kProxyObjectManagerCID, &rv);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = proxyMgr->GetProxyObject(NS_UI_THREAD_EVENTQ, // primordial thread - should change?
|
||||
NS_GET_IID(nsIProgressEventSink),
|
||||
sink,
|
||||
|
@ -504,6 +504,13 @@ nsresult nsHTTPHandler::ReleaseTransport(nsIChannel* i_pTrans)
|
||||
("nsHTTPHandler::ReleaseTransport."
|
||||
"\tReleasing socket transport %x.\n",
|
||||
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);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "Transport not in table...");
|
||||
|
Loading…
Reference in New Issue
Block a user