Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 334561b7 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 9544

* changes:
  free surface buffers before trying to allocate new ones, so we have more chance of success
parents d973863e a03f7c91
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -178,6 +178,7 @@ sp<Buffer> LayerBitmap::allocate()
{
{
    Mutex::Autolock _l(mLock);
    Mutex::Autolock _l(mLock);
    surface_info_t* info = mInfo;
    surface_info_t* info = mInfo;
    mBuffer.clear(); // free buffer before allocating a new one
    sp<Buffer> buffer = new Buffer(mWidth, mHeight, mFormat, mFlags);
    sp<Buffer> buffer = new Buffer(mWidth, mHeight, mFormat, mFlags);
    status_t err = buffer->initCheck();
    status_t err = buffer->initCheck();
    if (LIKELY(err == NO_ERROR)) {
    if (LIKELY(err == NO_ERROR)) {