(QNX) Implement destroy function correctly
This commit is contained in:
parent
089ab9441c
commit
d16395ffa6
|
@ -61,17 +61,31 @@ static void gfx_ctx_qnx_set_swap_interval(void *data, unsigned interval)
|
||||||
static void gfx_ctx_qnx_destroy(void *data)
|
static void gfx_ctx_qnx_destroy(void *data)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
eglMakeCurrent(g_egl_dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
|
||||||
eglDestroyContext(g_egl_dpy, g_egl_ctx);
|
|
||||||
eglDestroySurface(g_egl_dpy, g_egl_surf);
|
|
||||||
eglTerminate(g_egl_dpy);
|
|
||||||
//eglReleaseThread();
|
|
||||||
|
|
||||||
g_egl_dpy = EGL_NO_DISPLAY;
|
if (g_egl_dpy)
|
||||||
g_egl_surf = EGL_NO_SURFACE;
|
{
|
||||||
g_egl_ctx = EGL_NO_CONTEXT;
|
if (g_egl_ctx)
|
||||||
g_config = 0;
|
{
|
||||||
g_resize = false;
|
eglMakeCurrent(g_egl_dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||||
|
eglDestroyContext(g_egl_dpy, g_egl_ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (g_egl_hw_ctx)
|
||||||
|
eglDestroyContext(g_egl_dpy, g_egl_hw_ctx);
|
||||||
|
|
||||||
|
if (g_egl_surf)
|
||||||
|
eglDestroySurface(g_egl_dpy, g_egl_surf);
|
||||||
|
eglTerminate(g_egl_dpy);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Be as careful as possible in deinit.
|
||||||
|
|
||||||
|
g_egl_ctx = NULL;
|
||||||
|
g_egl_hw_ctx = NULL;
|
||||||
|
g_egl_surf = NULL;
|
||||||
|
g_egl_dpy = NULL;
|
||||||
|
g_config = 0;
|
||||||
|
g_resize = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_qnx_get_video_size(void *data, unsigned *width, unsigned *height)
|
static void gfx_ctx_qnx_get_video_size(void *data, unsigned *width, unsigned *height)
|
||||||
|
|
Loading…
Reference in New Issue