summaryrefslogtreecommitdiff
path: root/libs/hwui/PatchCache.cpp
diff options
context:
space:
mode:
author Chris Craik <ccraik@android.com> 2014-03-11 18:08:10 +0000
committer Android Git Automerger <android-git-automerger@android.com> 2014-03-11 18:08:10 +0000
commitfa03b57295f7c73372bb62b0a1a3e906c3ee659e (patch)
tree5611ddcae713f80eb3a3bbb814f68618403ee244 /libs/hwui/PatchCache.cpp
parent3ba975e75d1e09142dd6258fb9886d526f5cda69 (diff)
parent7b4cce68853d8bcfce2b6bd7f999915063eb56d2 (diff)
am 7b4cce68: am c3bac8a0: Merge "Fix graphics corruption caused by HWUI caches"
* commit '7b4cce68853d8bcfce2b6bd7f999915063eb56d2': Fix graphics corruption caused by HWUI caches
Diffstat (limited to 'libs/hwui/PatchCache.cpp')
-rw-r--r--libs/hwui/PatchCache.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/hwui/PatchCache.cpp b/libs/hwui/PatchCache.cpp
index dc0d98c2cb8d..8a446043b70f 100644
--- a/libs/hwui/PatchCache.cpp
+++ b/libs/hwui/PatchCache.cpp
@@ -129,7 +129,11 @@ void PatchCache::clearGarbage() {
Mutex::Autolock _l(mLock);
size_t count = mGarbage.size();
for (size_t i = 0; i < count; i++) {
- remove(patchesToRemove, mGarbage[i]);
+ Res_png_9patch* patch = mGarbage[i];
+ remove(patchesToRemove, patch);
+ // A Res_png_9patch is actually an array of byte that's larger
+ // than sizeof(Res_png_9patch). It must be freed as an array.
+ delete[] (int8_t*) patch;
}
mGarbage.clear();
}