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

Commit 46fcc6b3 authored by Jason Macnak's avatar Jason Macnak Committed by Android (Google) Code Review
Browse files

Merge "Avoid trying to disconnect twice with ANGLE" into sc-dev

parents 5e9c5b19 26c6f83a
Loading
Loading
Loading
Loading
+7 −3
Original line number Original line Diff line number Diff line
@@ -82,10 +82,14 @@ egl_surface_t::~egl_surface_t() {


void egl_surface_t::disconnect() {
void egl_surface_t::disconnect() {
    if (win != nullptr && connected) {
    if (win != nullptr && connected) {
        // NOTE: When using Vulkan backend, the Vulkan runtime makes all the
        // native_window_* calls, so don't do them here.
        if (!cnx->useAngle) {
            native_window_set_buffers_format(win, 0);
            native_window_set_buffers_format(win, 0);
            if (native_window_api_disconnect(win, NATIVE_WINDOW_API_EGL)) {
            if (native_window_api_disconnect(win, NATIVE_WINDOW_API_EGL)) {
                ALOGW("EGLNativeWindowType %p disconnect failed", win);
                ALOGW("EGLNativeWindowType %p disconnect failed", win);
            }
            }
        }
        connected = false;
        connected = false;
    }
    }
}
}