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

Commit 909f1072 authored by Jeff Boody's avatar Jeff Boody Committed by Giulio Cervera
Browse files

libRS: release last surface reference when shutting down GL

parent a7a9a70c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -137,6 +137,10 @@ LOCAL_C_INCLUDES += frameworks/compile/libbcc/include

LOCAL_CFLAGS += -Werror -Wall -Wno-unused-parameter -Wno-unused-variable

ifeq ($(BOARD_USES_QCOM_HARDWARE),true)
    LOCAL_CFLAGS += -DQCOM_HARDWARE
endif

LOCAL_LDLIBS := -lpthread -ldl
LOCAL_MODULE:= libRS
LOCAL_MODULE_TAGS := optional
+6 −0
Original line number Diff line number Diff line
@@ -138,6 +138,12 @@ void rsdGLShutdown(const Context *rsc) {
        if (dc->gl.egl.surface != EGL_NO_SURFACE) {
            RSD_CALL_GL(eglDestroySurface, dc->gl.egl.display, dc->gl.egl.surface);
        }
#ifdef QCOM_HARDWARE
        if (dc->gl.wndSurface != NULL) {
            dc->gl.wndSurface->decStrong(NULL);
            dc->gl.wndSurface = NULL;
        }
#endif
        RSD_CALL_GL(eglDestroyContext, dc->gl.egl.display, dc->gl.egl.context);
        checkEglError("eglDestroyContext");
    }