From: <dat...@us...> - 2006-08-18 03:50:03
|
Revision: 16826 Author: datallah Date: 2006-08-17 20:49:38 -0700 (Thu, 17 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16826&view=rev Log Message: ----------- Fix asserts at startup. Modified Paths: -------------- trunk/src/gtkstatusbox.c Modified: trunk/src/gtkstatusbox.c =================================================================== --- trunk/src/gtkstatusbox.c 2006-08-18 02:24:39 UTC (rev 16825) +++ trunk/src/gtkstatusbox.c 2006-08-18 03:49:38 UTC (rev 16826) @@ -1280,10 +1280,12 @@ { scaled = gdk_pixbuf_new_from_file_at_scale(status_box->buddy_icon_path, icon_alc.height, icon_alc.width, FALSE, NULL); - g_object_unref(status_box->buddy_icon_hover); + if (status_box->buddy_icon_hover) + g_object_unref(status_box->buddy_icon_hover); status_box->buddy_icon_hover = gdk_pixbuf_copy(scaled); do_colorshift(status_box->buddy_icon_hover, status_box->buddy_icon_hover, 30); - g_object_unref(status_box->buddy_icon); + if (status_box->buddy_icon) + g_object_unref(status_box->buddy_icon); status_box->buddy_icon = scaled; gtk_image_set_from_pixbuf(GTK_IMAGE(status_box->icon), status_box->buddy_icon); } @@ -1444,14 +1446,18 @@ { if (box->buddy_icon != NULL) g_object_unref(box->buddy_icon); - scaled = gdk_pixbuf_new_from_file_at_scale(filename, - box->icon_size, box->icon_size, FALSE, NULL); - if (scaled != NULL) - { - box->buddy_icon_hover = gdk_pixbuf_copy(scaled); - do_colorshift(box->buddy_icon_hover, box->buddy_icon_hover, 30); - box->buddy_icon = scaled; - gtk_image_set_from_pixbuf(GTK_IMAGE(box->icon), box->buddy_icon); + + /* This will get called before the box is shown and will not have a size */ + if (box->icon_size > 0) { + scaled = gdk_pixbuf_new_from_file_at_scale(filename, + box->icon_size, box->icon_size, FALSE, NULL); + if (scaled != NULL) + { + box->buddy_icon_hover = gdk_pixbuf_copy(scaled); + do_colorshift(box->buddy_icon_hover, box->buddy_icon_hover, 30); + box->buddy_icon = scaled; + gtk_image_set_from_pixbuf(GTK_IMAGE(box->icon), box->buddy_icon); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |