Commit e6d82c6d by Corentin Wallez

Fix order of TearDown of EGLSurfaceTest

Previously the OS window was deleted before the EGL window surface which caused the GLX window to be deleted after its X window was deleted. All this was invalid and resulted in a crash. BUG=angleproject:892 Change-Id: I394795b6ebce947ad7eeab9a70ad5f80fcd89241 Reviewed-on: https://chromium-review.googlesource.com/273055Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent aaa9eb94
...@@ -39,9 +39,6 @@ class EGLSurfaceTest : public testing::Test ...@@ -39,9 +39,6 @@ class EGLSurfaceTest : public testing::Test
// Release any resources created in the test body // Release any resources created in the test body
void TearDown() override void TearDown() override
{ {
mOSWindow->destroy();
SafeDelete(mOSWindow);
if (mDisplay != EGL_NO_DISPLAY) if (mDisplay != EGL_NO_DISPLAY)
{ {
eglMakeCurrent(mDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); eglMakeCurrent(mDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
...@@ -74,6 +71,9 @@ class EGLSurfaceTest : public testing::Test ...@@ -74,6 +71,9 @@ class EGLSurfaceTest : public testing::Test
mDisplay = EGL_NO_DISPLAY; mDisplay = EGL_NO_DISPLAY;
} }
mOSWindow->destroy();
SafeDelete(mOSWindow);
ASSERT_TRUE(mWindowSurface == EGL_NO_SURFACE && mContext == EGL_NO_CONTEXT); ASSERT_TRUE(mWindowSurface == EGL_NO_SURFACE && mContext == EGL_NO_CONTEXT);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment