Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60af8e3d authored by Weiwan Liu's avatar Weiwan Liu Committed by Yiwei Zhang
Browse files

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.

Bug: b/118093231
Test: NV internal regression tests including dEQP
Test: EGL_test --gtest_filter=EGLTest.EGLCreateWindowFailAndSucceed

Change-Id: I89712acf5ac40927e975357797a271c1bb680dbc
parent fbd9a282
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -732,6 +732,9 @@ EGLSurface eglCreateWindowSurfaceTmpl(egl_display_ptr dp, egl_connection_t* cnx,
    std::vector<AttrType> strippedAttribList;
    if (!processAttributes<AttrType>(dp, window, attrib_list, &colorSpace, &strippedAttribList)) {
        ALOGE("error invalid colorspace: %d", colorSpace);
        if (cnx->angleBackend != EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE) {
            native_window_api_disconnect(window, NATIVE_WINDOW_API_EGL);
        }
        return EGL_NO_SURFACE;
    }
    attrib_list = strippedAttribList.data();