From f0505514b2caecf0f64bdd668e0ce4949db01bb3 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 22 Jul 2004 02:19:19 +0000 Subject: [PATCH] Don't leak models. (#148128, Tommi Komulainen) Wed Jul 21 22:17:06 2004 Matthias Clasen * tests/testcombo.c (main): Don't leak models. (#148128, Tommi Komulainen) --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ tests/testcombo.c | 9 +++++++-- 5 files changed, 27 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 521699f90c..8d7d291ba5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Jul 21 22:17:06 2004 Matthias Clasen + + * tests/testcombo.c (main): Don't leak models. (#148128, + Tommi Komulainen) + Wed Jul 21 21:26:08 2004 Matthias Clasen * gtk/gtkviewport.c (viewport_set_adjustment): Don't leak diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 521699f90c..8d7d291ba5 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +Wed Jul 21 22:17:06 2004 Matthias Clasen + + * tests/testcombo.c (main): Don't leak models. (#148128, + Tommi Komulainen) + Wed Jul 21 21:26:08 2004 Matthias Clasen * gtk/gtkviewport.c (viewport_set_adjustment): Don't leak diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 521699f90c..8d7d291ba5 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +Wed Jul 21 22:17:06 2004 Matthias Clasen + + * tests/testcombo.c (main): Don't leak models. (#148128, + Tommi Komulainen) + Wed Jul 21 21:26:08 2004 Matthias Clasen * gtk/gtkviewport.c (viewport_set_adjustment): Don't leak diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 521699f90c..8d7d291ba5 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +Wed Jul 21 22:17:06 2004 Matthias Clasen + + * tests/testcombo.c (main): Don't leak models. (#148128, + Tommi Komulainen) + Wed Jul 21 21:26:08 2004 Matthias Clasen * gtk/gtkviewport.c (viewport_set_adjustment): Don't leak diff --git a/tests/testcombo.c b/tests/testcombo.c index 7f9f46697c..fd8555485a 100644 --- a/tests/testcombo.c +++ b/tests/testcombo.c @@ -110,6 +110,8 @@ create_combo_box_grid_demo () 0, create_color_pixbuf ("magenta"), -1); + g_object_unref (store); + gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0); return combo; @@ -229,13 +231,14 @@ main (int argc, char **argv) GtkWidget *tmp, *boom; GtkCellRenderer *renderer; GdkPixbuf *pixbuf; + GtkTreeModel *model; GValue value = {0, }; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_set_border_width (GTK_CONTAINER (window), 5); - g_signal_connect (window, "delete_event", gtk_main_quit, NULL); + g_signal_connect (window, "destroy", gtk_main_quit, NULL); mainbox = gtk_vbox_new (FALSE, 2); gtk_container_add (GTK_CONTAINER (window), mainbox); @@ -287,7 +290,9 @@ main (int argc, char **argv) gtk_container_set_border_width (GTK_CONTAINER (boom), 5); gtk_container_add (GTK_CONTAINER (tmp), boom); - combobox = gtk_combo_box_new_with_model (create_blaat ()); + model = create_blaat (); + combobox = gtk_combo_box_new_with_model (model); + g_object_unref (model); gtk_container_add (GTK_CONTAINER (boom), combobox); renderer = gtk_cell_renderer_pixbuf_new ();