fixes bug 270075 "crash @[nsFtpState::StopProcessing()]" r=biesi sr=bzbarsky

This commit is contained in:
darin%meer.net 2004-11-16 02:30:02 +00:00
parent 8f7bf9d9b8
commit 61373cec0e

View File

@ -193,6 +193,9 @@ nsFtpControlConnection::OnStartRequest(nsIRequest *request, nsISupports *aContex
if (!mListener)
return NS_OK;
// In case our listener tries to remove itself via SetStreamListener(nsnull),
// we need to keep an extra reference to it on the stack.
nsCOMPtr<nsIStreamListener> deathGrip = mListener;
return mListener->OnStartRequest(request, aContext);
}
@ -206,6 +209,9 @@ nsFtpControlConnection::OnStopRequest(nsIRequest *request, nsISupports *aContext
if (!mListener)
return NS_OK;
// In case our listener tries to remove itself via SetStreamListener(nsnull),
// we need to keep an extra reference to it on the stack.
nsCOMPtr<nsIStreamListener> deathGrip = mListener;
return mListener->OnStopRequest(request, aContext, aStatus);
}
@ -222,6 +228,9 @@ nsFtpControlConnection::OnDataAvailable(nsIRequest *request,
if (!mListener)
return NS_OK;
// In case our listener tries to remove itself via SetStreamListener(nsnull),
// we need to keep an extra reference to it on the stack.
nsCOMPtr<nsIStreamListener> deathGrip = mListener;
return mListener->OnDataAvailable(request, aContext, aInStream,
aOffset, aCount);
}