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

Commit a03f7c91 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

free surface buffers before trying to allocate new ones, so we have more chance of success

parent 746ff3f9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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)) {