EGL: add a missing native_window_api_disconnect
Add a native_window_api_disconnect for the case where
processAttributes() fails. Otherwise the next time this
function is called, it'll fail because native window is
still connected to the first API.
Test: NV internal regression tests including dEQP
Test: EGL_test --gtest_filter=EGLTest.EGLCreateWindowFailAndSucceed
Change-Id: I89712acf5ac40927e975357797a271c1bb680dbc
Merged-In: I89712acf5ac40927e975357797a271c1bb680dbc
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index 087c1c1..0e095dd 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -720,6 +720,7 @@
if (!processAttributes(dp, window, attrib_list, &colorSpace,
&strippedAttribList)) {
ALOGE("error invalid colorspace: %d", colorSpace);
+ native_window_api_disconnect(window, NATIVE_WINDOW_API_EGL);
return EGL_NO_SURFACE;
}
attrib_list = strippedAttribList.data();