[gtk+] GailImageCell: Deal with absence of pixbufs
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GailImageCell: Deal with absence of pixbufs
- Date: Tue, 5 Jul 2011 20:22:48 +0000 (UTC)
commit 7f44184f610ddf69a567295dc72db2e1312d51f7
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Jun 21 18:52:24 2011 -0400
GailImageCell: Deal with absence of pixbufs
...and when there are pixbufs, don't leak them.
gtk/a11y/gailimagecell.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/gtk/a11y/gailimagecell.c b/gtk/a11y/gailimagecell.c
index 078b4b7..b35b37e 100644
--- a/gtk/a11y/gailimagecell.c
+++ b/gtk/a11y/gailimagecell.c
@@ -160,11 +160,16 @@ gail_image_cell_get_image_size (AtkImage *image,
{
GailImageCell *cell = GAIL_IMAGE_CELL (image);
GtkCellRenderer *cell_renderer;
- GdkPixbuf *pixbuf;
+ GdkPixbuf *pixbuf = NULL;
cell_renderer = GAIL_RENDERER_CELL (cell)->renderer;
g_object_get (GTK_CELL_RENDERER_PIXBUF (cell_renderer), "pixbuf", &pixbuf, NULL);
- *width = gdk_pixbuf_get_width (pixbuf);
- *height = gdk_pixbuf_get_height (pixbuf);
+ if (pixbuf)
+ {
+ *width = gdk_pixbuf_get_width (pixbuf);
+ *height = gdk_pixbuf_get_height (pixbuf);
+
+ g_object_unref (pixbuf);
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]