diff options
author | Petar Jovanovic <petar.jovanovic@imgtec.com> | 2013-05-31 18:40:19 +0200 |
---|---|---|
committer | The Android Automerger <android-build@android.com> | 2013-06-05 15:37:58 -0700 |
commit | 4ff83db4ab46c0d997d0ca966fc6c94531e6b784 (patch) | |
tree | d0c2797379a505fc33b006c36036df0454847cf7 | |
parent | 80fb025e6c886f2a4fced38c93307051e7528885 (diff) | |
download | device_generic_goldfish-4ff83db4ab46c0d997d0ca966fc6c94531e6b784.tar.gz device_generic_goldfish-4ff83db4ab46c0d997d0ca966fc6c94531e6b784.tar.bz2 device_generic_goldfish-4ff83db4ab46c0d997d0ca966fc6c94531e6b784.zip |
Flush QemuPipeStream when neededandroid-4.3_r1.1android-4.3_r1android-4.3_r0.9.1android-4.3_r0.9jb-mr2-release
Under some circumstances, close color buffer messages in the command stream
do not reach the host as the size of the undelivered commands is small.
This results in refcounts of ColorBuffer never dropping to zero and color
buffers not being freed.
The patch calls flush at the end of rcCloseColorBuffer_enc().
In addition, the stream is flushed before it is deleted in the destructor of
QemuPipeStream, since it may also have important messages.
bug: 9278661
Change-Id: I46f20af8e0c272ec8d831d62f57cb2f22c7b28a7
-rw-r--r-- | opengl/system/OpenglSystemCommon/QemuPipeStream.cpp | 1 | ||||
-rw-r--r-- | opengl/system/renderControl_enc/renderControl_enc.cpp | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/opengl/system/OpenglSystemCommon/QemuPipeStream.cpp b/opengl/system/OpenglSystemCommon/QemuPipeStream.cpp index 50c3d8bb..a55dca0b 100644 --- a/opengl/system/OpenglSystemCommon/QemuPipeStream.cpp +++ b/opengl/system/OpenglSystemCommon/QemuPipeStream.cpp @@ -40,6 +40,7 @@ QemuPipeStream::QemuPipeStream(int sock, size_t bufSize) : QemuPipeStream::~QemuPipeStream() { if (m_sock >= 0) { + flush(); ::close(m_sock); } if (m_buf != NULL) { diff --git a/opengl/system/renderControl_enc/renderControl_enc.cpp b/opengl/system/renderControl_enc/renderControl_enc.cpp index 94e256ad..41f59d0c 100644 --- a/opengl/system/renderControl_enc/renderControl_enc.cpp +++ b/opengl/system/renderControl_enc/renderControl_enc.cpp @@ -311,6 +311,8 @@ void rcCloseColorBuffer_enc(void *self , uint32_t colorbuffer) memcpy(ptr, &packetSize, 4); ptr += 4; memcpy(ptr, &colorbuffer, 4); ptr += 4; + + stream->flush(); } void rcSetWindowColorBuffer_enc(void *self , uint32_t windowSurface, uint32_t colorBuffer) |