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
This commit is contained in:
Romain Guy
2011-06-22 15:13:09 -07:00
parent c989d867f2
commit f6a63ae3a7

View File

@@ -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) {