From 11ab39617e0b247dd6a7001980fe29950c518859 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 12 Feb 2020 14:23:01 -0500 Subject: [PATCH] Fix the Emoji chooser finalize If the Emoji chooser is finalized before the idle has run, it would spew criticals, breaking some tests. Avoid that. --- gtk/gtkemojichooser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk/gtkemojichooser.c b/gtk/gtkemojichooser.c index 00a9edc262..36d3e35cfc 100644 --- a/gtk/gtkemojichooser.c +++ b/gtk/gtkemojichooser.c @@ -110,8 +110,8 @@ gtk_emoji_chooser_finalize (GObject *object) if (chooser->populate_idle) g_source_remove (chooser->populate_idle); - g_variant_unref (chooser->data); - g_object_unref (chooser->settings); + g_clear_pointer (&chooser->data, g_variant_unref); + g_clear_object (&chooser->settings); G_OBJECT_CLASS (gtk_emoji_chooser_parent_class)->finalize (object); }