Index: src/core/SkRWBuffer.cpp |
diff --git a/src/core/SkRWBuffer.cpp b/src/core/SkRWBuffer.cpp |
index bbf88ddfe304abccff809db917bda89715705c25..f0b565edf3f685360844dace2af2997de810b5ed 100644 |
--- a/src/core/SkRWBuffer.cpp |
+++ b/src/core/SkRWBuffer.cpp |
@@ -42,8 +42,6 @@ |
return amount; |
} |
- // Do not call in the reader thread, since the writer may be updating fUsed. |
- // (The assertion is still true, but TSAN still may complain about its raciness.) |
void validate() const { |
#ifdef SK_DEBUG |
SkASSERT(fCapacity > 0); |
@@ -96,7 +94,7 @@ |
} |
} |
- void validate(size_t minUsed, const SkBufferBlock* tail = nullptr) const { |
+ void validate(size_t minUsed, SkBufferBlock* tail = nullptr) const { |
#ifdef SK_DEBUG |
SkASSERT(fRefCnt > 0); |
size_t totalUsed = 0; |
@@ -134,6 +132,7 @@ |
SkROBuffer::~SkROBuffer() { |
if (fHead) { |
+ fHead->validate(fAvailable); |
fHead->unref(); |
} |
} |
@@ -143,7 +142,7 @@ |
} |
void SkROBuffer::Iter::reset(const SkROBuffer* buffer) { |
- if (buffer && buffer->fHead) { |
+ if (buffer) { |
fBlock = &buffer->fHead->fBlock; |
fRemaining = buffer->fAvailable; |
} else { |