зеркало из https://github.com/mozilla/pjs.git
110366 r/sr=darin, addref the reader before using it so that it doesn't get released from under us.
This commit is contained in:
Родитель
241f6cc71a
Коммит
730f567767
|
@ -364,6 +364,7 @@ nsStorageTransport::AsyncRead(nsIStreamListener *aListener,
|
|||
NS_NEWXPCOM(reader, nsReadRequest);
|
||||
if (!reader)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(reader);
|
||||
|
||||
reader->SetTransport(this);
|
||||
reader->SetTransferOffset(aOffset);
|
||||
|
@ -379,11 +380,11 @@ nsStorageTransport::AsyncRead(nsIStreamListener *aListener,
|
|||
rv = reader->Process();
|
||||
if (NS_FAILED(rv)) goto error;
|
||||
|
||||
NS_ADDREF(*aRequest = reader);
|
||||
*aRequest = reader;
|
||||
return NS_OK;
|
||||
|
||||
error:
|
||||
NS_DELETEXPCOM(reader);
|
||||
NS_RELEASE(reader);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче