From 13c5ca3b5562ac673a08b17790d89460729c6e7d Mon Sep 17 00:00:00 2001 From: Jamie Gennis Date: Tue, 18 Oct 2011 17:14:33 -0700 Subject: [PATCH] SurfaceTexture: free buffers when disconnect fails This change makes SurfaceTextureClient free its references to all the buffers even when the disconnect binder call to the SurfaceTexture fails. Bug: 5384823 Change-Id: Iad787fbae5fda4769546fd52276e4e4030c62be6 --- libs/gui/SurfaceTextureClient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp index 0bee0f17c..98fa17174 100644 --- a/libs/gui/SurfaceTextureClient.cpp +++ b/libs/gui/SurfaceTextureClient.cpp @@ -409,9 +409,9 @@ int SurfaceTextureClient::connect(int api) { int SurfaceTextureClient::disconnect(int api) { LOGV("SurfaceTextureClient::disconnect"); Mutex::Autolock lock(mMutex); + freeAllBuffers(); int err = mSurfaceTexture->disconnect(api); if (!err) { - freeAllBuffers(); mReqFormat = 0; mReqWidth = 0; mReqHeight = 0;