зеркало из https://github.com/mozilla/gecko-dev.git
Bug 763013 - Race condition in async stream copier. r=biesi
This commit is contained in:
Родитель
1b4959b372
Коммит
ef45415f51
|
@ -244,9 +244,12 @@ nsAsyncStreamCopier::AsyncCopy(nsIRequestObserver *observer, nsISupports *ctx)
|
|||
// we want to receive progress notifications; release happens in
|
||||
// OnAsyncCopyComplete.
|
||||
NS_ADDREF_THIS();
|
||||
rv = NS_AsyncCopy(mSource, mSink, mTarget, mMode, mChunkSize,
|
||||
OnAsyncCopyComplete, this, mCloseSource, mCloseSink,
|
||||
getter_AddRefs(mCopierCtx));
|
||||
{
|
||||
MutexAutoLock lock(mLock);
|
||||
rv = NS_AsyncCopy(mSource, mSink, mTarget, mMode, mChunkSize,
|
||||
OnAsyncCopyComplete, this, mCloseSource, mCloseSink,
|
||||
getter_AddRefs(mCopierCtx));
|
||||
}
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_RELEASE_THIS();
|
||||
Cancel(rv);
|
||||
|
|
Загрузка…
Ссылка в новой задаче