mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 1242597 - Fix nsSocketTransport reference loop r=dragana
This commit is contained in:
parent
15b0e5ff03
commit
12bc0ce356
@ -473,7 +473,11 @@ nsSocketInputStream::AsyncWait(nsIInputStreamCallback *callback,
|
||||
bool hasError = false;
|
||||
{
|
||||
MutexAutoLock lock(mTransport->mLock);
|
||||
|
||||
if (mTransport->mState != nsSocketTransport::STATE_TRANSFERRING && NS_FAILED(mCondition)) {
|
||||
SOCKET_LOG(("nsSocketInputStream::AsyncWait [this=%p] "
|
||||
"Not Transferring %X.\n", mTransport, mCondition));
|
||||
return NS_OK;
|
||||
}
|
||||
if (callback && target) {
|
||||
//
|
||||
// build event proxy
|
||||
@ -707,7 +711,12 @@ nsSocketOutputStream::AsyncWait(nsIOutputStreamCallback *callback,
|
||||
|
||||
{
|
||||
MutexAutoLock lock(mTransport->mLock);
|
||||
|
||||
if (mTransport->mState != nsSocketTransport::STATE_TRANSFERRING && NS_FAILED(mCondition)) {
|
||||
// do not take the callback reference if we will not call onOutputReady
|
||||
SOCKET_LOG(("nsSocketOutputStream::AsyncWait [this=%p] mTransport=%p "
|
||||
"Not Transferring %X.\n",this, mTransport, mCondition));
|
||||
return NS_OK;
|
||||
}
|
||||
if (callback && target) {
|
||||
//
|
||||
// build event proxy
|
||||
|
@ -187,7 +187,6 @@ private:
|
||||
|
||||
enum {
|
||||
STATE_CLOSED,
|
||||
STATE_IDLE,
|
||||
STATE_RESOLVING,
|
||||
STATE_CONNECTING,
|
||||
STATE_TRANSFERRING
|
||||
|
Loading…
Reference in New Issue
Block a user