diff --git a/mozilla/xpcom/io/nsPipe2.cpp b/mozilla/xpcom/io/nsPipe2.cpp index 9452e951a29..b22f8ed97d0 100644 --- a/mozilla/xpcom/io/nsPipe2.cpp +++ b/mozilla/xpcom/io/nsPipe2.cpp @@ -399,7 +399,9 @@ nsPipe::nsPipeInputStream::ReadSegments(nsWriteSegmentFun writer, readBufferLen = PR_MIN(readBufferLen, amt); while (readBufferLen > 0) { PRUint32 writeCount = 0; + mon.Exit(); // XXX avoid deadlock better rv = writer(this, closure, readBuffer, *readCount, readBufferLen, &writeCount); + mon.Enter(); if (NS_FAILED(rv) && rv != NS_BASE_STREAM_WOULD_BLOCK) goto done; NS_ASSERTION(writeCount <= readBufferLen, "writer returned bad writeCount"); @@ -690,7 +692,9 @@ nsPipe::nsPipeOutputStream::WriteSegments(nsReadSegmentFun reader, writeBufLen = PR_MIN(writeBufLen, amt); while (writeBufLen > 0) { PRUint32 readCount = 0; + mon.Exit(); // XXX avoid deadlock better rv = reader(this, closure, writeBuf, *writeCount, writeBufLen, &readCount); + mon.Enter(); if (rv == NS_BASE_STREAM_WOULD_BLOCK) { NS_ASSERTION(readCount <= writeBufLen, "reader returned bad readCount"); // XXX should not update counters if reader returned WOULD_BLOCK!! diff --git a/mozilla/xpcom/proxy/src/nsProxyEvent.cpp b/mozilla/xpcom/proxy/src/nsProxyEvent.cpp index 7356b6f0aa8..6b0b3519f0c 100644 --- a/mozilla/xpcom/proxy/src/nsProxyEvent.cpp +++ b/mozilla/xpcom/proxy/src/nsProxyEvent.cpp @@ -296,10 +296,7 @@ nsProxyObject::Release(void) ProxyDestructorEventHandler, ProxyDestructorDestroyHandler); - // fire it off. - mDestQueue->PostSynchronousEvent(event, nsnull); - - PR_DELETE(event); + mDestQueue->PostEvent(event); return 0; } return mRefCnt; @@ -540,5 +537,6 @@ static void* ProxyDestructorEventHandler(PLEvent *self) static void ProxyDestructorDestroyHandler(PLEvent *self) { + PR_DELETE(self); }