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>
(cherry picked from commit bcec6df78e
)
This commit is contained in:
parent
fb327dfb4d
commit
6f489292b9
4 changed files with 2 additions and 7 deletions
|
@ -43,8 +43,6 @@ typedef struct _CoglXlibRenderer
|
|||
Display *xdpy;
|
||||
|
||||
unsigned long outputs_update_serial;
|
||||
|
||||
XVisualInfo *xvisinfo;
|
||||
} CoglXlibRenderer;
|
||||
|
||||
gboolean
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -781,7 +781,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))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue