diff options
author | Romain Guy <romainguy@google.com> | 2011-06-22 15:13:09 -0700 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2011-06-22 15:13:09 -0700 |
commit | f6a63ae3a7004a8eca87fca5a66cfb6aef4e86b5 (patch) | |
tree | dda8a54686dc15261602a0953c8564fb2322ffdb /libs/hwui | |
parent | c989d867f2580a99cde25fab0e49e445aea33f2f (diff) | |
download | frameworks_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.h | 4 |
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) { |