Bug 1019934 - don't access mRefCnt after CacheFileChunk::DispatchRelease() has been called, r=michal

This commit is contained in:
Honza Bambas 2014-06-05 18:27:38 +02:00
parent b1feb7e13a
commit 98973a62fd

View File

@ -63,13 +63,14 @@ NS_IMPL_ADDREF(CacheFileChunk)
NS_IMETHODIMP_(MozExternalRefCountType)
CacheFileChunk::Release()
{
nsrefcnt count = mRefCnt - 1;
if (DispatchRelease()) {
// Redispatched to the main thread.
return mRefCnt - 1;
return count;
}
NS_PRECONDITION(0 != mRefCnt, "dup release");
nsrefcnt count = --mRefCnt;
count = --mRefCnt;
NS_LOG_RELEASE(this, count, "CacheFileChunk");
if (0 == count) {