gtk-demo: Fix a crash in the font explorer demo

gtk_widget_add_controller is transfer-full.
This commit is contained in:
Matthias Clasen 2019-12-23 22:33:02 -05:00
parent 33716d1e50
commit db42c23c0a

View File

@ -1228,7 +1228,7 @@ do_font_features (GtkWidget *do_widget)
edit_toggle = GTK_WIDGET (gtk_builder_get_object (builder, "edit_toggle")); edit_toggle = GTK_WIDGET (gtk_builder_get_object (builder, "edit_toggle"));
controller = gtk_event_controller_key_new (); controller = gtk_event_controller_key_new ();
g_object_set_data_full (G_OBJECT (entry), "controller", controller, g_object_unref); g_object_set_data_full (G_OBJECT (entry), "controller", g_object_ref (controller), g_object_unref);
g_signal_connect (controller, "key-pressed", G_CALLBACK (entry_key_press), entry); g_signal_connect (controller, "key-pressed", G_CALLBACK (entry_key_press), entry);
gtk_widget_add_controller (entry, controller); gtk_widget_add_controller (entry, controller);