From cb21c37853cf67ab91ae324e7887a1561f879056 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 ff49c87db311..5221fed56f4d 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