diff --git a/netwerk/protocol/ftp/src/nsFtpControlConnection.cpp b/netwerk/protocol/ftp/src/nsFtpControlConnection.cpp index c131f071604..623e00eb845 100644 --- a/netwerk/protocol/ftp/src/nsFtpControlConnection.cpp +++ b/netwerk/protocol/ftp/src/nsFtpControlConnection.cpp @@ -111,14 +111,15 @@ nsFtpControlConnection::Connect(nsIProxyInfo* proxyInfo) if (NS_FAILED(rv)) return rv; // open buffered, non-blocking/asynchronous input stream to socket. + nsCOMPtr inStream; rv = mCPipe->OpenInputStream(0, FTP_COMMAND_CHANNEL_SEG_SIZE, FTP_COMMAND_CHANNEL_SEG_COUNT, - getter_AddRefs(mInStream)); + getter_AddRefs(inStream)); if (NS_FAILED(rv)) return rv; nsCOMPtr pump; - rv = NS_NewInputStreamPump(getter_AddRefs(pump), mInStream); + rv = NS_NewInputStreamPump(getter_AddRefs(pump), inStream); if (NS_FAILED(rv)) return rv; // get the ball rolling by reading on the control socket. @@ -140,12 +141,11 @@ nsFtpControlConnection::Disconnect(nsresult status) if (NS_FAILED(status)) { // break cyclic reference! + mOutStream = 0; mReadRequest->Cancel(status); mReadRequest = 0; mCPipe->Close(status); mCPipe = 0; - mInStream = 0; - mOutStream = 0; } return NS_OK; diff --git a/netwerk/protocol/ftp/src/nsFtpControlConnection.h b/netwerk/protocol/ftp/src/nsFtpControlConnection.h index e07c25af2c6..e68e3d26a08 100644 --- a/netwerk/protocol/ftp/src/nsFtpControlConnection.h +++ b/netwerk/protocol/ftp/src/nsFtpControlConnection.h @@ -87,7 +87,6 @@ private: nsCOMPtr mReadRequest; nsCOMPtr mCPipe; - nsCOMPtr mInStream; nsCOMPtr mOutStream; nsCOMPtr mListener; };