diff --git a/cogl/cogl/cogl-xlib-renderer-private.h b/cogl/cogl/cogl-xlib-renderer-private.h index 3574fdc1b..8169129ef 100644 --- a/cogl/cogl/cogl-xlib-renderer-private.h +++ b/cogl/cogl/cogl-xlib-renderer-private.h @@ -43,8 +43,6 @@ typedef struct _CoglXlibRenderer Display *xdpy; unsigned long outputs_update_serial; - - XVisualInfo *xvisinfo; } CoglXlibRenderer; gboolean diff --git a/cogl/cogl/cogl-xlib-renderer.c b/cogl/cogl/cogl-xlib-renderer.c index e2950d9b2..71cb43eba 100644 --- a/cogl/cogl/cogl-xlib-renderer.c +++ b/cogl/cogl/cogl-xlib-renderer.c @@ -55,9 +55,6 @@ static GList *_cogl_xlib_renderers = NULL; static void _xlib_renderer_data_free (CoglXlibRenderer *data) { - if (data->xvisinfo) - XFree (data->xvisinfo); - g_free (data); } diff --git a/cogl/cogl/winsys/cogl-winsys-egl-x11.c b/cogl/cogl/winsys/cogl-winsys-egl-x11.c index 7a52129c2..7393f79f6 100644 --- a/cogl/cogl/winsys/cogl-winsys-egl-x11.c +++ b/cogl/cogl/winsys/cogl-winsys-egl-x11.c @@ -404,7 +404,7 @@ _cogl_winsys_egl_context_created (CoglDisplay *display, } } - xlib_renderer->xvisinfo = xvisinfo; + g_clear_pointer (&xvisinfo, XFree); if (!_cogl_winsys_egl_make_current (display, egl_display->dummy_surface, diff --git a/cogl/cogl/winsys/cogl-winsys-glx.c b/cogl/cogl/winsys/cogl-winsys-glx.c index 9cab939d3..ee1a7f734 100644 --- a/cogl/cogl/winsys/cogl-winsys-glx.c +++ b/cogl/cogl/winsys/cogl-winsys-glx.c @@ -779,7 +779,7 @@ create_context (CoglDisplay *display, GError **error) dummy_drawable, glx_display->glx_context); - xlib_renderer->xvisinfo = xvisinfo; + g_clear_pointer (&xvisinfo, XFree); if (mtk_x11_error_trap_pop_with_return (xlib_renderer->xdpy)) {