mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 18:08:58 +00:00
Fix for about:blank to work -- not destroy the listener prematurely in the OnStopRequest method.
This commit is contained in:
parent
00f9c67d96
commit
d3c6265c13
@ -18,6 +18,7 @@
|
||||
|
||||
#include "nsInputStreamChannel.h"
|
||||
#include "nsIStreamListener.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsInputStreamChannel methods:
|
||||
@ -126,6 +127,11 @@ nsInputStreamChannel::AsyncRead(PRUint32 startPosition, PRInt32 readCount,
|
||||
{
|
||||
// currently this happens before AsyncRead returns -- hope that's ok
|
||||
nsresult rv;
|
||||
|
||||
// Do an extra AddRef so that this method's synchronous operation doesn't end up destroying
|
||||
// the listener prematurely.
|
||||
nsCOMPtr<nsIStreamListener> l(listener);
|
||||
|
||||
rv = listener->OnStartRequest(ctxt);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user