diff --git a/content/base/src/nsSyncLoadService.cpp b/content/base/src/nsSyncLoadService.cpp index 073e2991fdd..7f1f6367550 100644 --- a/content/base/src/nsSyncLoadService.cpp +++ b/content/base/src/nsSyncLoadService.cpp @@ -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; diff --git a/extensions/xmlextras/base/src/nsXMLHttpRequest.cpp b/extensions/xmlextras/base/src/nsXMLHttpRequest.cpp index 0bb0d70f12b..9be9b82e2ba 100644 --- a/extensions/xmlextras/base/src/nsXMLHttpRequest.cpp +++ b/extensions/xmlextras/base/src/nsXMLHttpRequest.cpp @@ -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; }