[mutter] backends/x11: Unref keymap on finalize
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] backends/x11: Unref keymap on finalize
- Date: Sat, 13 Mar 2021 15:59:57 +0000 (UTC)
commit 0e396ee7bb38d485b3a2284637bd15c69c7ce062
Author: Sebastian Keller <skeller gnome org>
Date: Thu Feb 11 15:46:13 2021 +0100
backends/x11: Unref keymap on finalize
Despite keymaps being relatively large, this does not really have much
of an impact, because there is only ever one and it's only leaked on
shutdown.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1728>
src/backends/x11/meta-backend-x11.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
---
diff --git a/src/backends/x11/meta-backend-x11.c b/src/backends/x11/meta-backend-x11.c
index 9c40ada2c1..ae1a916280 100644
--- a/src/backends/x11/meta-backend-x11.c
+++ b/src/backends/x11/meta-backend-x11.c
@@ -874,6 +874,17 @@ meta_backend_x11_dispose (GObject *object)
G_OBJECT_CLASS (meta_backend_x11_parent_class)->dispose (object);
}
+static void
+meta_backend_x11_finalize (GObject *object)
+{
+ MetaBackendX11 *x11 = META_BACKEND_X11 (object);
+ MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
+
+ g_clear_pointer (&priv->keymap, xkb_keymap_unref);
+
+ G_OBJECT_CLASS (meta_backend_x11_parent_class)->finalize (object);
+}
+
static void
meta_backend_x11_class_init (MetaBackendX11Class *klass)
{
@@ -881,6 +892,7 @@ meta_backend_x11_class_init (MetaBackendX11Class *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = meta_backend_x11_dispose;
+ object_class->finalize = meta_backend_x11_finalize;
backend_class->create_clutter_backend = meta_backend_x11_create_clutter_backend;
backend_class->post_init = meta_backend_x11_post_init;
backend_class->grab_device = meta_backend_x11_grab_device;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]