1
0
Fork 0

cogl: Do not store the XVisualInfo

We were leaking one instance because _cogl_winsys_egl_context_created()
could be potentially be called twice (via cogl_display_setup() one as
part of cogl_renderer_check_onscreen_template() and the other when
called from clutter_backend_do_real_create_context()), and so we'd ended
up overwriting the reference we had.

However, we really didn't use it anywhere and once used to call the
relevant functions it's just useless.

So let's just keep it as local variable

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3788>
This commit is contained in:
Marco Trevisan (Treviño) 2024-05-30 18:22:39 +02:00 committed by Marge Bot
parent 0fda3ab8a1
commit bcec6df78e
4 changed files with 2 additions and 7 deletions

View file

@ -43,8 +43,6 @@ typedef struct _CoglXlibRenderer
Display *xdpy;
unsigned long outputs_update_serial;
XVisualInfo *xvisinfo;
} CoglXlibRenderer;
gboolean

View file

@ -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);
}

View file

@ -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,

View file

@ -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))
{