summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mathias Agopian <mathias@google.com> 2009-07-31 16:44:12 -0700
committer Mathias Agopian <mathias@google.com> 2009-08-03 15:08:16 -0700
commita03f7c9170ca5bf3ce68470a9d112ffebde1f143 (patch)
tree8925704da3e23d9386671ca175769bd922e31e69
parent746ff3f925ac1b913f0eed28cd4f927a1c2bd5b8 (diff)
free surface buffers before trying to allocate new ones, so we have more chance of success
-rw-r--r--libs/surfaceflinger/LayerBitmap.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/libs/surfaceflinger/LayerBitmap.cpp b/libs/surfaceflinger/LayerBitmap.cpp
index ff49c87db3..5221fed56f 100644
--- a/libs/surfaceflinger/LayerBitmap.cpp
+++ b/libs/surfaceflinger/LayerBitmap.cpp
@@ -178,6 +178,7 @@ sp<Buffer> LayerBitmap::allocate()
{
Mutex::Autolock _l(mLock);
surface_info_t* info = mInfo;
+ mBuffer.clear(); // free buffer before allocating a new one
sp<Buffer> buffer = new Buffer(mWidth, mHeight, mFormat, mFlags);
status_t err = buffer->initCheck();
if (LIKELY(err == NO_ERROR)) {