summaryrefslogtreecommitdiff
path: root/libs/hwui/TessellationCache.cpp
diff options
context:
space:
mode:
author Mykola Kondratenko <mykola.kondratenko@sonymobile.com> 2015-03-12 15:20:38 +0100
committer Henrik Baard <henrik.baard@sonymobile.com> 2015-03-17 08:57:41 +0100
commitb159633aa3b91301de108a0b32e4634c72f34d14 (patch)
tree6a1afed560dac8141242f6abb6ea51cae75784dd /libs/hwui/TessellationCache.cpp
parent9aeb080eec2286e8604901bd2b8248be4e527107 (diff)
hwui : fix memory leak due to duplicate in shadow cache
New ShadowTask with the ShadowDescription key that already exists in the shadow LruCache will leak as it is not being added. Fix adds check for the existing key that is common in the hwui code but missing for the TessellationCache::precacheShadow function. Change-Id: I37fd5ec82f8b8da5d1ec0f2ab9fd04c5f8534367
Diffstat (limited to 'libs/hwui/TessellationCache.cpp')
-rw-r--r--libs/hwui/TessellationCache.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/libs/hwui/TessellationCache.cpp b/libs/hwui/TessellationCache.cpp
index bc956be8a059..1d6b7cc94fc7 100644
--- a/libs/hwui/TessellationCache.cpp
+++ b/libs/hwui/TessellationCache.cpp
@@ -380,6 +380,7 @@ void TessellationCache::precacheShadows(const Matrix4* drawTransform, const Rect
const Vector3& lightCenter, float lightRadius) {
ShadowDescription key(casterPerimeter, drawTransform);
+ if (mShadowCache.get(key)) return;
sp<ShadowTask> task = new ShadowTask(drawTransform, localClip, opaque,
casterPerimeter, transformXY, transformZ, lightCenter, lightRadius);
if (mShadowProcessor == NULL) {