From f013764b57a8c40b454b61cd557f406f960cbaf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 24 May 2023 15:25:33 +0200 Subject: [PATCH] x11/backend-x11: Close the X11 Display where it's created We open the clutter backend display inside MetaBackendX11, but we end up closing it MetaClutterBackendX11, that is not it's direct owner. So do it where it belongs Part-of: --- src/backends/x11/meta-backend-x11.c | 2 ++ src/backends/x11/meta-clutter-backend-x11.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backends/x11/meta-backend-x11.c b/src/backends/x11/meta-backend-x11.c index d44f83a73..50fd57812 100644 --- a/src/backends/x11/meta-backend-x11.c +++ b/src/backends/x11/meta-backend-x11.c @@ -942,6 +942,8 @@ meta_backend_x11_dispose (GObject *object) } G_OBJECT_CLASS (meta_backend_x11_parent_class)->dispose (object); + + g_clear_pointer (&priv->xdisplay, XCloseDisplay); } static void diff --git a/src/backends/x11/meta-clutter-backend-x11.c b/src/backends/x11/meta-clutter-backend-x11.c index 345c1424d..2c43e9f35 100644 --- a/src/backends/x11/meta-clutter-backend-x11.c +++ b/src/backends/x11/meta-clutter-backend-x11.c @@ -153,8 +153,6 @@ meta_clutter_backend_x11_finalize (GObject *gobject) cogl_xlib_filter, clutter_backend_x11); - XCloseDisplay (clutter_backend_x11->xdisplay); - G_OBJECT_CLASS (meta_clutter_backend_x11_parent_class)->finalize (gobject); }