[telegnome] Add missing call to gdk_pixbuf_loader_close



commit 31626a904449c1efc14e3c719915338b6cd293d2
Author: Colin Watson <cjwatson debian org>
Date:   Sat Jan 30 18:13:02 2016 +0000

    Add missing call to gdk_pixbuf_loader_close
    
    * src/http.c (tg_http_get_image): Call gdk_pixbuf_loader_close before
    gdk_pixbuf_loader_get_pixbuf.
    * NEWS: Document this.

 NEWS       |    2 ++
 src/http.c |   11 +++++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/NEWS b/NEWS
index 025582e..2ede6e1 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ Changes in TeleGNOME 0.2.0
  * Port from GnomeVFS to GIO.
  * Port from gnome-config to GSettings.
  * Add some more default channels.
+ * Add missing call to gdk_pixbuf_loader_close that caused TeleGNOME to be
+   unable to load some images.
 
 Changes in TeleGNOME 0.1.1
 ==========================
diff --git a/src/http.c b/src/http.c
index 7382887..a8af6f7 100644
--- a/src/http.c
+++ b/src/http.c
@@ -112,6 +112,17 @@ tg_http_get_image (GdkPixbuf **pixbuf)
        }
     }
 
+    err = NULL;
+    if (!gdk_pixbuf_loader_close(loader, &err)) {
+       if (err) {
+           g_warning("Unable to parse image from '%s': %s",
+                     http_query, err->message);
+           g_error_free(err);
+       }
+       retval = TG_ERR_PIXBUF;
+       goto out;
+    }
+
     *pixbuf = gdk_pixbuf_loader_get_pixbuf(loader);
     if (!*pixbuf) {
        g_warning("Pixbuf loader did not create a pixbuf from '%s'",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]