diff options
author | Benjamin Otte <otte@redhat.com> | 2019-03-29 05:36:12 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2019-03-29 09:56:52 +0100 |
commit | 7918eaf677ff5aecd07993d31d760cd0c60d2958 (patch) | |
tree | c06bf60fce69f6a77e7571037f270d5f715df746 /gtk/gtkpicture.c | |
parent | bf2a93ca0ea9721e162deefe7fa9707563de87bc (diff) | |
download | gtk+-7918eaf677ff5aecd07993d31d760cd0c60d2958.tar.gz |
picture: Don't cause warnings on load failures
When a file set via gtk_picture_set_file() can't be loaded, just
silently don't load it.
Reftest picture-load-invalid-file added for that case.
Diffstat (limited to 'gtk/gtkpicture.c')
-rw-r--r-- | gtk/gtkpicture.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gtk/gtkpicture.c b/gtk/gtkpicture.c index 3dc7c9b91b..b6ecd2f696 100644 --- a/gtk/gtkpicture.c +++ b/gtk/gtkpicture.c @@ -604,6 +604,7 @@ load_scalable_with_loader (GFile *file, out2: g_bytes_unref (bytes); out1: + gdk_pixbuf_loader_close (loader, NULL); g_object_unref (loader); return result; @@ -637,7 +638,7 @@ gtk_picture_set_file (GtkPicture *self, paintable = load_scalable_with_loader (file, gtk_widget_get_scale_factor (GTK_WIDGET (self))); gtk_picture_set_paintable (self, paintable); - g_object_unref (paintable); + g_clear_object (&paintable); g_object_thaw_notify (G_OBJECT (self)); } |