gtk-demo: Fix a refcounting mishap
authorMatthias Clasen <mclasen@redhat.com>
Sat, 23 Sep 2023 11:47:09 +0000 (07:47 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 28 Sep 2023 00:42:44 +0000 (20:42 -0400)
gtk_font_dialog_button_new's argument is
transfer full.

Fixes: #6113
demos/gtk-demo/fishbowl.c

index a5d58787c1b0aff1921ccbedf26095868c5cfa4d..0e365fb65a043ac8c9c9c6df9e08a9e5c8975dbc 100644 (file)
@@ -71,14 +71,7 @@ create_blurred_button (void)
 static GtkWidget *
 create_font_button (void)
 {
-  GtkFontDialog *dialog;
-  GtkWidget *button;
-
-  dialog = gtk_font_dialog_new ();
-  button = gtk_font_dialog_button_new (dialog);
-  g_object_unref (dialog);
-
-  return button;
+  return gtk_font_dialog_button_new (gtk_font_dialog_new ());
 }
 
 static GtkWidget *