diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-11-15 23:03:30 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-11-15 23:03:30 -0500 |
commit | 08d6db4ab6c940bb3a042a0ee5693d56ffad3f15 (patch) | |
tree | c7c10dd32043123d63d4d11a852a84698346a41d /demos | |
parent | 6891f401107ce400729de86f75e7160d99c3f1cf (diff) | |
download | gtk+-08d6db4ab6c940bb3a042a0ee5693d56ffad3f15.tar.gz |
gtk-demo: Plug a memory leak
The Characters demo was leaking its columns.
Diffstat (limited to 'demos')
-rw-r--r-- | demos/gtk-demo/listview_ucd.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/demos/gtk-demo/listview_ucd.c b/demos/gtk-demo/listview_ucd.c index 35f0523812..418e7ca418 100644 --- a/demos/gtk-demo/listview_ucd.c +++ b/demos/gtk-demo/listview_ucd.c @@ -284,12 +284,14 @@ create_ucd_view (GtkWidget *label) g_signal_connect (factory, "bind", G_CALLBACK (bind_codepoint), NULL); column = gtk_column_view_column_new ("Codepoint", factory); gtk_column_view_append_column (GTK_COLUMN_VIEW (cv), column); + g_object_unref (column); factory = gtk_signal_list_item_factory_new (); g_signal_connect (factory, "setup", G_CALLBACK (setup_centered_label), NULL); g_signal_connect (factory, "bind", G_CALLBACK (bind_char), NULL); column = gtk_column_view_column_new ("Char", factory); gtk_column_view_append_column (GTK_COLUMN_VIEW (cv), column); + g_object_unref (column); factory = gtk_signal_list_item_factory_new (); g_signal_connect (factory, "setup", G_CALLBACK (setup_ellipsizing_label), NULL); @@ -297,6 +299,7 @@ create_ucd_view (GtkWidget *label) column = gtk_column_view_column_new ("Name", factory); gtk_column_view_column_set_resizable (column, TRUE); gtk_column_view_append_column (GTK_COLUMN_VIEW (cv), column); + g_object_unref (column); factory = gtk_signal_list_item_factory_new (); g_signal_connect (factory, "setup", G_CALLBACK (setup_ellipsizing_label), NULL); @@ -304,6 +307,7 @@ create_ucd_view (GtkWidget *label) column = gtk_column_view_column_new ("Type", factory); gtk_column_view_column_set_resizable (column, TRUE); gtk_column_view_append_column (GTK_COLUMN_VIEW (cv), column); + g_object_unref (column); factory = gtk_signal_list_item_factory_new (); g_signal_connect (factory, "setup", G_CALLBACK (setup_ellipsizing_label), NULL); @@ -311,6 +315,7 @@ create_ucd_view (GtkWidget *label) column = gtk_column_view_column_new ("Break Type", factory); gtk_column_view_column_set_resizable (column, TRUE); gtk_column_view_append_column (GTK_COLUMN_VIEW (cv), column); + g_object_unref (column); factory = gtk_signal_list_item_factory_new (); g_signal_connect (factory, "setup", G_CALLBACK (setup_label), NULL); @@ -318,6 +323,7 @@ create_ucd_view (GtkWidget *label) column = gtk_column_view_column_new ("Combining Class", factory); gtk_column_view_column_set_resizable (column, TRUE); gtk_column_view_append_column (GTK_COLUMN_VIEW (cv), column); + g_object_unref (column); factory = gtk_signal_list_item_factory_new (); g_signal_connect (factory, "setup", G_CALLBACK (setup_label), NULL); @@ -325,6 +331,7 @@ create_ucd_view (GtkWidget *label) column = gtk_column_view_column_new ("Script", factory); gtk_column_view_column_set_resizable (column, TRUE); gtk_column_view_append_column (GTK_COLUMN_VIEW (cv), column); + g_object_unref (column); return cv; } |