forked from AuroraMiddleware/gtk
GailImageCell: Deal with absence of pixbufs
...and when there are pixbufs, don't leak them.
This commit is contained in:
parent
0f8823b4a4
commit
7f44184f61
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user