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

Commit 9648c1a2 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

make sure clear the draw and read EGLSurface when eglMakeCurrent() is called...

make sure clear the draw and read EGLSurface when eglMakeCurrent() is called for unbinding from the thread
parent f909cb6c
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -384,7 +384,7 @@ void egl_window_surface_v2_t::connect()

void egl_window_surface_v2_t::disconnect() 
{
    if (buffer) {
    if (buffer && bits) {
        bits = NULL;
        unlock(buffer);
    }
@@ -1681,10 +1681,12 @@ EGLBoolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw,
                egl_surface_t* d = (egl_surface_t*)c->draw;
                egl_surface_t* r = (egl_surface_t*)c->read;
                if (d) {
                    c->draw = 0;
                    d->ctx = EGL_NO_CONTEXT;
                    d->disconnect();
                }
                if (r) {
                    c->read = 0;
                    r->ctx = EGL_NO_CONTEXT;
                    // FIXME: unlock/disconnect the read surface too 
                }