Bug 671053: Explicitly drop nsHttpConnection's ref to the callbacks at transaction close rather than waiting for connection reuse/expiration. r=mcmanus
authorKyle Huey <khuey@kylehuey.com>
Thu, 14 Jul 2011 11:09:48 -0700
changeset 72817 a4d88ea926ecbe79c74fd660f2ae09edd94358fa
parent 72816 89b5fccb0514139df2746fbc222b409a2a0c12fd
child 72818 52617959b48ec07390eb47b200884f0513ea6212
child 104911 c6f79afa04d51f0bc0b07f51db33bb2eea3f31d3
push id20773
push userkhuey@mozilla.com
push dateThu, 14 Jul 2011 18:10:33 +0000
treeherdermozilla-central@a4d88ea926ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus
bugs671053
milestone8.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 671053: Explicitly drop nsHttpConnection's ref to the callbacks at transaction close rather than waiting for connection reuse/expiration. r=mcmanus
netwerk/protocol/http/nsHttpConnection.cpp
--- a/netwerk/protocol/http/nsHttpConnection.cpp
+++ b/netwerk/protocol/http/nsHttpConnection.cpp
@@ -625,16 +625,22 @@ nsHttpConnection::CloseTransaction(nsAHt
 
     // mask this error code because its not a real error.
     if (reason == NS_BASE_STREAM_CLOSED)
         reason = NS_OK;
 
     mTransaction->Close(reason);
     mTransaction = nsnull;
 
+    if (mCallbacks) {
+        nsIInterfaceRequestor *cbs = nsnull;
+        mCallbacks.swap(cbs);
+        NS_ProxyRelease(mCallbackTarget, cbs);
+    }
+
     if (NS_FAILED(reason))
         Close(reason);
 
     // flag the connection as reused here for convenience sake.  certainly
     // it might be going away instead ;-)
     mIsReused = PR_TRUE;
 }