diff options
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 |
commit | cb21c37853cf67ab91ae324e7887a1561f879056 (patch) | |
tree | d99f6560b7b3a25ba59c7972cfdc92911aa2ce2e /libs/surfaceflinger | |
parent | d186ef12b352c0e62fccd3243ed59a430b07837a (diff) | |
download | frameworks_base-cb21c37853cf67ab91ae324e7887a1561f879056.zip frameworks_base-cb21c37853cf67ab91ae324e7887a1561f879056.tar.gz frameworks_base-cb21c37853cf67ab91ae324e7887a1561f879056.tar.bz2 |
free surface buffers before trying to allocate new ones, so we have more chance of success
Diffstat (limited to 'libs/surfaceflinger')
-rw-r--r-- | libs/surfaceflinger/LayerBitmap.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libs/surfaceflinger/LayerBitmap.cpp b/libs/surfaceflinger/LayerBitmap.cpp index ff49c87..5221fed 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)) { |