mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-06 08:40:08 +00:00
entry: guard for != NULL before unreffing the pixbuf
In gtk_entry_get_icon_pixbuf() we unreference the pixbuf that _gtk_icon_helper_ensure_pixbuf() gives us back, since the function doesn't return a reference, and by doing so we're able to return the reference owned by the cached icon helper. Since the icon helper method can return NULL though, if no icon properties have been set on it, guard for != NULL before unreffing the pixbuf, as that would cause a critical warning. https://bugzilla.gnome.org/show_bug.cgi?id=679537
This commit is contained in:
parent
5dbf3a576a
commit
f30eab099b
@ -7946,7 +7946,8 @@ gtk_entry_get_icon_pixbuf (GtkEntry *entry,
|
||||
* the icon helper's cache ref directly.
|
||||
*/
|
||||
pixbuf = gtk_entry_ensure_pixbuf (entry, icon_pos);
|
||||
g_object_unref (pixbuf);
|
||||
if (pixbuf)
|
||||
g_object_unref (pixbuf);
|
||||
|
||||
return pixbuf;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user