void eng_window_free(Evas_GL_Wl_Window *gw) { int ref = 0; win_count--; eng_window_use(gw); if (gw == _evas_gl_wl_window) _evas_gl_wl_window = NULL; // if (gw->win) wl_egl_window_destroy(gw->win); if (gw->gl_context) { ref = gw->gl_context->references - 1; evas_gl_common_context_free(gw->gl_context); } if (gw->egl_surface[0] != EGL_NO_SURFACE) eglDestroySurface(gw->egl_disp, gw->egl_surface[0]); eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); if (ref == 0) { if (context) eglDestroyContext(gw->egl_disp, context); context = EGL_NO_CONTEXT; /* NB: This is causing an unknown hang when we run elm apps as * wayland clients inside the weston compositor */ /* eglTerminate(gw->egl_disp); */ eglReleaseThread(); } free(gw); }
void eng_window_free(Evas_GL_Glew_Window *gw) { if (!gw) return; if (gw == _evas_gl_glew_window) _evas_gl_glew_window = NULL; evas_gl_common_context_free(gw->gl_context); wglMakeCurrent(NULL, NULL); wglDeleteContext(gw->context); ReleaseDC(gw->window, gw->dc); free(gw); }