projects
/
platform
/
upstream
/
libSkiaSharp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a644116
)
Fix DiscardableMemoryPool::free race condition
author
halcanary
<halcanary@google.com>
Thu, 26 Mar 2015 21:08:56 +0000
(14:08 -0700)
committer
Commit bot
<commit-bot@chromium.org>
Thu, 26 Mar 2015 21:08:56 +0000
(14:08 -0700)
BUG=skia:3596
Review URL: https://codereview.chromium.org/
1017943003
src/lazy/SkDiscardableMemoryPool.cpp
patch
|
blob
|
history
diff --git
a/src/lazy/SkDiscardableMemoryPool.cpp
b/src/lazy/SkDiscardableMemoryPool.cpp
index
1f48366
..
5b9d87f
100644
(file)
--- 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);