Bug 559927 - nsAsyncStreamCopier::mCopierCtx not consistently protected by ::mLock. r=cbiesi

This commit is contained in:
Julian Seward 2010-04-29 10:39:46 +02:00
Родитель 5264479104
Коммит ded0f10dcc
1 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -283,9 +283,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));
{
nsAutoLock 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);