From e6e76e1cac60c978e6f86d3f813e577e722cb23d Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Wed, 17 Dec 2003 22:56:27 +0000 Subject: [PATCH] if we set a new stock_id and there was a previous stock_id, unref the Wed Dec 17 23:50:56 2003 Kristian Rietveld * gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_set_property): if we set a new stock_id and there was a previous stock_id, unref the pixbuf (since it was used to renderer the previous stock_id and stock_id might have been set to NULL now). (Fixes #122966). --- ChangeLog | 7 +++++++ ChangeLog.pre-2-10 | 7 +++++++ ChangeLog.pre-2-4 | 7 +++++++ ChangeLog.pre-2-6 | 7 +++++++ ChangeLog.pre-2-8 | 7 +++++++ gtk/gtkcellrendererpixbuf.c | 9 ++++++++- 6 files changed, 43 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c379ace58c..330716fa94 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Wed Dec 17 23:50:56 2003 Kristian Rietveld + + * gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_set_property): + if we set a new stock_id and there was a previous stock_id, unref + the pixbuf (since it was used to renderer the previous stock_id + and stock_id might have been set to NULL now). (Fixes #122966). + 2003-12-17 Marco Pesenti Gritti * gtk/gtktreemodelsort.c: (gtk_tree_model_sort_get_iter): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index c379ace58c..330716fa94 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +Wed Dec 17 23:50:56 2003 Kristian Rietveld + + * gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_set_property): + if we set a new stock_id and there was a previous stock_id, unref + the pixbuf (since it was used to renderer the previous stock_id + and stock_id might have been set to NULL now). (Fixes #122966). + 2003-12-17 Marco Pesenti Gritti * gtk/gtktreemodelsort.c: (gtk_tree_model_sort_get_iter): diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index c379ace58c..330716fa94 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,10 @@ +Wed Dec 17 23:50:56 2003 Kristian Rietveld + + * gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_set_property): + if we set a new stock_id and there was a previous stock_id, unref + the pixbuf (since it was used to renderer the previous stock_id + and stock_id might have been set to NULL now). (Fixes #122966). + 2003-12-17 Marco Pesenti Gritti * gtk/gtktreemodelsort.c: (gtk_tree_model_sort_get_iter): diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index c379ace58c..330716fa94 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,10 @@ +Wed Dec 17 23:50:56 2003 Kristian Rietveld + + * gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_set_property): + if we set a new stock_id and there was a previous stock_id, unref + the pixbuf (since it was used to renderer the previous stock_id + and stock_id might have been set to NULL now). (Fixes #122966). + 2003-12-17 Marco Pesenti Gritti * gtk/gtktreemodelsort.c: (gtk_tree_model_sort_get_iter): diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index c379ace58c..330716fa94 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,10 @@ +Wed Dec 17 23:50:56 2003 Kristian Rietveld + + * gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_set_property): + if we set a new stock_id and there was a previous stock_id, unref + the pixbuf (since it was used to renderer the previous stock_id + and stock_id might have been set to NULL now). (Fixes #122966). + 2003-12-17 Marco Pesenti Gritti * gtk/gtktreemodelsort.c: (gtk_tree_model_sort_get_iter): diff --git a/gtk/gtkcellrendererpixbuf.c b/gtk/gtkcellrendererpixbuf.c index 64fa881354..6c6a6007ea 100644 --- a/gtk/gtkcellrendererpixbuf.c +++ b/gtk/gtkcellrendererpixbuf.c @@ -277,7 +277,14 @@ gtk_cell_renderer_pixbuf_set_property (GObject *object, break; case PROP_STOCK_ID: if (cellinfo->stock_id) - g_free (cellinfo->stock_id); + { + if (cellpixbuf->pixbuf) + { + g_object_unref (cellpixbuf->pixbuf); + cellpixbuf->pixbuf = NULL; + } + g_free (cellinfo->stock_id); + } cellinfo->stock_id = g_strdup (g_value_get_string (value)); break; case PROP_STOCK_SIZE: