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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user