mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
fixes bug 190860 "trunk topcrash [@ _PR_Getfd]" r=dougt sr=bz a=asa
This commit is contained in:
parent
a01da841e5
commit
d021d7d179
@ -266,6 +266,10 @@ nsInputStreamPump::AsyncRead(nsIStreamListener *listener, nsISupports *ctxt)
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
|
||||
// release our reference to the original stream. from this point forward,
|
||||
// we only reference the "stream" via mAsyncStream.
|
||||
mStream = 0;
|
||||
|
||||
// mStreamOffset now holds the number of bytes currently read. we use this
|
||||
// to enforce the mStreamLength restriction.
|
||||
mStreamOffset = 0;
|
||||
@ -456,11 +460,13 @@ nsInputStreamPump::OnStateStop()
|
||||
{
|
||||
LOG((" OnStateStop [this=%x status=%x]\n", this, mStatus));
|
||||
|
||||
// in most cases mAsyncStream is already closed (NOTE: Close is idempotent).
|
||||
// however, mAsyncStream may still be open if mStreamLength was reached
|
||||
// before EOF.
|
||||
if (mCloseWhenDone)
|
||||
mStream->Close();
|
||||
mStream = 0;
|
||||
mAsyncStream = 0;
|
||||
mAsyncStream->Close();
|
||||
|
||||
mAsyncStream = 0;
|
||||
mEventQ = 0;
|
||||
mIsPending = PR_FALSE;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user