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

Commit 578b7a22 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

fix [3367893] Rotating device on YouTube's home screen several times kills system_server

A typo in RS tear down cause caused eglMakeCurrent to fail. Additionnaly,
EGLSurfaces where not destroyed explicitely.
Everything worked properly when only one RS context was used, as
eglTerminate() would clean-up everything.

however in the present case, there seem to be more than one RS context
and eglTerminate() is not called.

Change-Id: I37a10945b9c0a85c4f7abad1c4f4c24bc0daa0a5
parent 7a97ad42
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -253,7 +253,11 @@ void Context::deinitEGL() {
    LOGV("%p, deinitEGL", this);

    if (mEGL.mContext != EGL_NO_CONTEXT) {
        eglMakeCurrent(mEGL.mDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, mEGL.mContext);
        eglMakeCurrent(mEGL.mDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
        eglDestroySurface(mEGL.mDisplay, mEGL.mSurfaceDefault);
        if (mEGL.mSurface != EGL_NO_SURFACE) {
            eglDestroySurface(mEGL.mDisplay, mEGL.mSurface);
        }
        eglDestroyContext(mEGL.mDisplay, mEGL.mContext);
        checkEglError("eglDestroyContext");
    }