summaryrefslogtreecommitdiffstats
path: root/libs/hwui
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-06-22 15:13:09 -0700
committerRomain Guy <romainguy@google.com>2011-06-22 15:13:09 -0700
commitf6a63ae3a7004a8eca87fca5a66cfb6aef4e86b5 (patch)
treedda8a54686dc15261602a0953c8564fb2322ffdb /libs/hwui
parentc989d867f2580a99cde25fab0e49e445aea33f2f (diff)
downloadframeworks_base-f6a63ae3a7004a8eca87fca5a66cfb6aef4e86b5.zip
frameworks_base-f6a63ae3a7004a8eca87fca5a66cfb6aef4e86b5.tar.gz
frameworks_base-f6a63ae3a7004a8eca87fca5a66cfb6aef4e86b5.tar.bz2
Fix memory leak in OpenGLRenderer.
When creating a display list, matrices are duplicated locally. They were however never deleted, thus causing apps to slowly leak memory (a matrix is about 40 bytes.) Change-Id: Iac465b720d4c4c9b5ca3fce870c0c912c14a74ab
Diffstat (limited to 'libs/hwui')
-rw-r--r--libs/hwui/DisplayListRenderer.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/hwui/DisplayListRenderer.h b/libs/hwui/DisplayListRenderer.h
index dcf2cf2..98c341f 100644
--- a/libs/hwui/DisplayListRenderer.h
+++ b/libs/hwui/DisplayListRenderer.h
@@ -419,7 +419,9 @@ private:
inline void addMatrix(SkMatrix* matrix) {
// Copying the matrix is cheap and prevents against the user changing the original
// matrix before the operation that uses it
- addInt((int) new SkMatrix(*matrix));
+ SkMatrix* copy = new SkMatrix(*matrix);
+ addInt((int) copy);
+ mMatrices.add(copy);
}
inline void addBitmap(SkBitmap* bitmap) {