diff --git a/netwerk/protocol/http/nsHttpPipeline.cpp b/netwerk/protocol/http/nsHttpPipeline.cpp index 0efdc2e9ecd..68c8ea2f0f7 100644 --- a/netwerk/protocol/http/nsHttpPipeline.cpp +++ b/netwerk/protocol/http/nsHttpPipeline.cpp @@ -62,8 +62,7 @@ private: //----------------------------------------------------------------------------- nsHttpPipeline::nsHttpPipeline() - : mConnection(nullptr) - , mStatus(NS_OK) + : mStatus(NS_OK) , mRequestIsPartial(false) , mResponseIsPartial(false) , mClosed(false) @@ -83,8 +82,6 @@ nsHttpPipeline::~nsHttpPipeline() // make sure we aren't still holding onto any transactions! Close(NS_ERROR_ABORT); - NS_IF_RELEASE(mConnection); - if (mPushBackBuf) free(mPushBackBuf); } @@ -410,13 +407,13 @@ nsHttpPipeline::SetConnection(nsAHttpConnection *conn) MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread); MOZ_ASSERT(!conn || !mConnection, "already have a connection"); - NS_IF_ADDREF(mConnection = conn); + mConnection = conn; } nsAHttpConnection * nsHttpPipeline::Connection() { - LOG(("nsHttpPipeline::Connection [this=%p conn=%x]\n", this, mConnection)); + LOG(("nsHttpPipeline::Connection [this=%p conn=%x]\n", this, mConnection.get())); MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread); return mConnection; diff --git a/netwerk/protocol/http/nsHttpPipeline.h b/netwerk/protocol/http/nsHttpPipeline.h index f0f6c128328..d97ccf56a5b 100644 --- a/netwerk/protocol/http/nsHttpPipeline.h +++ b/netwerk/protocol/http/nsHttpPipeline.h @@ -58,7 +58,7 @@ private: // overload of nsAHttpTransaction::QueryPipeline() nsHttpPipeline *QueryPipeline(); - nsAHttpConnection *mConnection; + nsRefPtr mConnection; nsTArray mRequestQ; // array of transactions nsTArray mResponseQ; // array of transactions nsresult mStatus;