From 4ac36f80beb958c77a92a3e1a235f6ed9daaa510 Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Tue, 9 Dec 2014 16:54:03 -0800 Subject: Fix frame-allocated path lifecycles bug:18667472 Previously, we were allocating per-frame temporary paths within the PlaybackStateStruct, but these are not safe as layers allocate these transiently. Instead, move these to the OpenGLRenderer, which has better define lifecycle. Additionally, don't store SkPath objects directly in vector, since they are then subject to relocation. Change-Id: I8187ef542fcd5b030502bb75eb123ee26c0daa96 --- libs/hwui/OpenGLRenderer.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libs/hwui/OpenGLRenderer.cpp') diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 075f2c509b24..96257e4b474a 100755 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -311,6 +311,11 @@ void OpenGLRenderer::finish() { renderOverdraw(); endTiling(); + for (size_t i = 0; i < mTempPaths.size(); i++) { + delete mTempPaths[i]; + } + mTempPaths.clear(); + // When finish() is invoked on FBO 0 we've reached the end // of the current frame if (getTargetFbo() == 0) { -- cgit v1.2.3-59-g8ed1b