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

Commit 3ac517a8 authored by Sai Kiran Korwar's avatar Sai Kiran Korwar Committed by Robert Tray
Browse files

egl: Call loseCurrent after eglReleaseThread

Call the device specific eglReleaseThread before the the device
independent egl_display_t::loseCurrent.  loseCurrent will reset
the surface format in the destructor.  The device specific code
needs an opportunity to finish things up before surface state is
changed.

Change-Id: Icfc79eba440a6c03bd68aacc087402a8c785dd4a
parent 3f0d5669
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1304,13 +1304,14 @@ EGLBoolean eglReleaseThread(void)
        GLTrace_eglReleaseThread();
#endif

    // If there is context bound to the thread, release it
    egl_display_t::loseCurrent(get_context(getContext()));

    egl_connection_t* const cnx = &gEGLImpl;
    if (cnx->dso && cnx->egl.eglReleaseThread) {
        cnx->egl.eglReleaseThread();
    }

    // If there is context bound to the thread, release it
    egl_display_t::loseCurrent(get_context(getContext()));

    egl_tls_t::clearTLS();
    return EGL_TRUE;
}