aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/lazy
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2015-03-26 14:08:56 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-26 14:08:56 -0700
commit2edf599eebd370d5a95cafb2a668c4e9e0e9c094 (patch)
tree16c4a2269ba5a8d2ae5023471e3aef0c5ab68be0 /src/lazy
parenta644116c3375b12c642d1b51ee1e5cf4a22c1f5b (diff)
Fix DiscardableMemoryPool::free race condition
Diffstat (limited to 'src/lazy')
-rw-r--r--src/lazy/SkDiscardableMemoryPool.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lazy/SkDiscardableMemoryPool.cpp b/src/lazy/SkDiscardableMemoryPool.cpp
index 1f4836604d..5b9d87ff2f 100644
--- a/src/lazy/SkDiscardableMemoryPool.cpp
+++ b/src/lazy/SkDiscardableMemoryPool.cpp
@@ -188,9 +188,9 @@ SkDiscardableMemory* DiscardableMemoryPool::create(size_t bytes) {
}
void DiscardableMemoryPool::free(PoolDiscardableMemory* dm) {
+ SkAutoMutexAcquire autoMutexAcquire(fMutex);
// This is called by dm's destructor.
if (dm->fPointer != NULL) {
- SkAutoMutexAcquire autoMutexAcquire(fMutex);
sk_free(dm->fPointer);
dm->fPointer = NULL;
SkASSERT(fUsed >= dm->fBytes);