Fix DiscardableMemoryPool::free race condition
BUG=skia:3596 Review URL: https://codereview.chromium.org/1017943003
This commit is contained in:
parent
a644116c33
commit
2edf599eeb
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user