From e11f3ab000ec8d71e816aea7f266a3ceafebfd56 Mon Sep 17 00:00:00 2001 From: Samsung Date: Wed, 24 Sep 2014 10:52:13 -0700 Subject: Fixing memory leak in RenderBufferCache In our devices with higher resolution we have observed a memory leak in the HWUI code. When there is GC or tree modification and buffer size is greater than the default size, we make sure buffer is deleted. Change-Id: Idf7052ccaf43c8a784ce0e7bdab336dca29bffd8 Signed-off-by: Samsung --- libs/hwui/RenderBufferCache.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/hwui/RenderBufferCache.cpp b/libs/hwui/RenderBufferCache.cpp index 830a13a..022820b 100644 --- a/libs/hwui/RenderBufferCache.cpp +++ b/libs/hwui/RenderBufferCache.cpp @@ -158,6 +158,11 @@ bool RenderBufferCache::put(RenderBuffer* buffer) { buffer->getWidth(), buffer->getHeight()); return true; + } else { + RENDER_BUFFER_LOGD("Deleted %s render buffer (%dx%d) Size=%d, MaxSize=%d", + RenderBuffer::formatName(buffer->getFormat()), + buffer->getWidth(), buffer->getHeight(), size, mMaxSize); + delete buffer; } return false; } -- cgit v1.1