Don't leak the channel and XMLHttpRequest object if AsyncOpen fails. Bug

323454, r=biesi, sr=darin
This commit is contained in:
bzbarsky%mit.edu 2006-02-21 00:00:44 +00:00
parent d6aef8e3c8
commit 80ea4604ed
2 changed files with 6 additions and 0 deletions

View File

@ -441,6 +441,9 @@ nsSyncLoader::PushAsyncStream(nsIStreamListener* aListener)
}
}
// Note that if AsyncOpen failed that's ok -- the only caller of
// this method nulls out mChannel immediately after we return.
service->PopThreadEventQueue(currentThreadQ);
return rv;

View File

@ -1641,6 +1641,9 @@ nsXMLHttpRequest::Send(nsIVariant *aBody)
if (modalEventQueue) {
mEventQService->PopThreadEventQueue(modalEventQueue);
}
// Drop our ref to the channel to avoid cycles
mChannel = nsnull;
return rv;
}