From e68a52b0a2fbf239c23e622bda45ae50ee7e82ab Mon Sep 17 00:00:00 2001 From: Jamie Gennis Date: Tue, 30 Aug 2011 19:04:42 -0700 Subject: SurfaceTexture: fix a test deadlock This change fixes a test issue that resulted in a deadlock. Change-Id: I4729e8dd47c8f5fea49bfeff3cea58627ead6d04 Bug: 5174876 --- libs/gui/tests/SurfaceTexture_test.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/gui/tests/SurfaceTexture_test.cpp b/libs/gui/tests/SurfaceTexture_test.cpp index 44babcf873..b8bc454782 100644 --- a/libs/gui/tests/SurfaceTexture_test.cpp +++ b/libs/gui/tests/SurfaceTexture_test.cpp @@ -974,8 +974,6 @@ TEST_F(SurfaceTextureGLTest, TexturingFromGLFilledRGBABufferPow2) { eglSwapBuffers(mEglDisplay, stcEglSurface); - eglDestroySurface(mEglDisplay, stcEglSurface); - // Do the consumer side of things EXPECT_TRUE(eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mEglContext)); @@ -985,6 +983,10 @@ TEST_F(SurfaceTextureGLTest, TexturingFromGLFilledRGBABufferPow2) { mST->updateTexImage(); + // We must wait until updateTexImage has been called to destroy the + // EGLSurface because we're in synchronous mode. + eglDestroySurface(mEglDisplay, stcEglSurface); + glClearColor(0.2, 0.2, 0.2, 0.2); glClear(GL_COLOR_BUFFER_BIT); -- cgit v1.2.3-59-g8ed1b