Skip to content

Commit 32704dc

Browse files
author
Jamie Gennis
committed
SurfaceTexture: fix a test deadlock
This change fixes a test issue that resulted in a deadlock. Change-Id: I4729e8dd47c8f5fea49bfeff3cea58627ead6d04 Bug: 5174876
1 parent 9c93db6 commit 32704dc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

libs/gui/tests/SurfaceTexture_test.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -974,8 +974,6 @@ TEST_F(SurfaceTextureGLTest, TexturingFromGLFilledRGBABufferPow2) {
974974

975975
eglSwapBuffers(mEglDisplay, stcEglSurface);
976976

977-
eglDestroySurface(mEglDisplay, stcEglSurface);
978-
979977
// Do the consumer side of things
980978
EXPECT_TRUE(eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface,
981979
mEglContext));
@@ -985,6 +983,10 @@ TEST_F(SurfaceTextureGLTest, TexturingFromGLFilledRGBABufferPow2) {
985983

986984
mST->updateTexImage();
987985

986+
// We must wait until updateTexImage has been called to destroy the
987+
// EGLSurface because we're in synchronous mode.
988+
eglDestroySurface(mEglDisplay, stcEglSurface);
989+
988990
glClearColor(0.2, 0.2, 0.2, 0.2);
989991
glClear(GL_COLOR_BUFFER_BIT);
990992

0 commit comments

Comments
 (0)