From 5379a4bf347cdaa2f8e9eba12fceb3c7419c882d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 9 Nov 2020 14:38:55 -0500 Subject: [PATCH] a11y: Clean up properly in unregister_object Things that are set up in register_object should be cleaned up in unregister_object. --- gtk/a11y/gtkatspicontext.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gtk/a11y/gtkatspicontext.c b/gtk/a11y/gtkatspicontext.c index 7b3db2cf6b..98bde0a0e7 100644 --- a/gtk/a11y/gtkatspicontext.c +++ b/gtk/a11y/gtkatspicontext.c @@ -1387,9 +1387,11 @@ gtk_at_spi_context_unregister_object (GtkAtSpiContext *self) self->registration_ids[self->n_registered_objects]); self->registration_ids[self->n_registered_objects] = 0; } + + g_clear_pointer (&self->interfaces, g_variant_unref); } /* }}} */ -/* {{{ GObject boilerplate */ +/* {{{ GObject boilerplate */ static void gtk_at_spi_context_finalize (GObject *gobject) { @@ -1399,7 +1401,6 @@ gtk_at_spi_context_finalize (GObject *gobject) g_free (self->bus_address); g_free (self->context_path); - g_clear_pointer (&self->interfaces, g_variant_unref); G_OBJECT_CLASS (gtk_at_spi_context_parent_class)->finalize (gobject); }