diff options
author | halcanary <halcanary@google.com> | 2015-03-26 14:08:56 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-26 14:08:56 -0700 |
commit | 2edf599eebd370d5a95cafb2a668c4e9e0e9c094 (patch) | |
tree | 16c4a2269ba5a8d2ae5023471e3aef0c5ab68be0 /src/lazy | |
parent | a644116c3375b12c642d1b51ee1e5cf4a22c1f5b (diff) |
Fix DiscardableMemoryPool::free race condition
BUG=skia:3596
Review URL: https://codereview.chromium.org/1017943003
Diffstat (limited to 'src/lazy')
-rw-r--r-- | src/lazy/SkDiscardableMemoryPool.cpp | 2 |
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); |