From a03f7c9170ca5bf3ce68470a9d112ffebde1f143 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Fri, 31 Jul 2009 16:44:12 -0700 Subject: free surface buffers before trying to allocate new ones, so we have more chance of success --- libs/surfaceflinger/LayerBitmap.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'libs/surfaceflinger/LayerBitmap.cpp') 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 LayerBitmap::allocate() { Mutex::Autolock _l(mLock); surface_info_t* info = mInfo; + mBuffer.clear(); // free buffer before allocating a new one sp buffer = new Buffer(mWidth, mHeight, mFormat, mFlags); status_t err = buffer->initCheck(); if (LIKELY(err == NO_ERROR)) { -- cgit v1.2.3-59-g8ed1b