diff options
| author | 2011-04-08 19:10:43 -0700 | |
|---|---|---|
| committer | 2011-04-08 19:28:04 -0700 | |
| commit | 5f05f99aaedaba18c426fac287bcb18d56dbe881 (patch) | |
| tree | 791dab7fb51fb0e49663e9af9f8ac9f44f9242ec /include/gui/SurfaceTexture.h | |
| parent | 7797e647fc8fcd5091b9449c0044f5cb70db5b47 (diff) | |
Fix a GraphicBuffer leak in SurfaceTexture
This leak was intentional, it was there to deal with the fact that
some gralloc implementations don't track buffer handles with
file-descriptors so buffers needed to stay alive until there were
registered, which is not guaranteed by binder transactions.
In this new implementation, we use a small BBinder holding a
reference to the buffer, which with tuck into the parcel. This forces
the reference to stay alive until the parcel is destroyed, which
is guaranteed (by construction) to happen after the buffer is
registered.
this allows the public facing API to not expose the previous hack.
Change-Id: I1dd6cd83679a2b7457ad628169e2851acc027143
Diffstat (limited to 'include/gui/SurfaceTexture.h')
| -rw-r--r-- | include/gui/SurfaceTexture.h | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/include/gui/SurfaceTexture.h b/include/gui/SurfaceTexture.h index 585d288ed26a..340daaf14efd 100644 --- a/include/gui/SurfaceTexture.h +++ b/include/gui/SurfaceTexture.h @@ -248,12 +248,6 @@ private: // allocate new GraphicBuffer objects. sp<IGraphicBufferAlloc> mGraphicBufferAlloc; - // mAllocdBuffers is mirror of the list of buffers that SurfaceFlinger is - // referencing. This is kept so that gralloc implementations do not need to - // properly handle the case where SurfaceFlinger no longer holds a reference - // to a buffer, but other processes do. - Vector<sp<GraphicBuffer> > mAllocdBuffers; - // mFrameAvailableListener is the listener object that will be called when a // new frame becomes available. If it is not NULL it will be called from // queueBuffer. |