[gdk-pixbuf] jpeg: Use g_clear_object() when possible



commit 99f6ac080cbd931dc1092fd54b62477fe81fadc5
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Jul 13 18:53:46 2017 +0200

    jpeg: Use g_clear_object() when possible

 gdk-pixbuf/io-jpeg.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c
index 05ca959..f59676f 100644
--- a/gdk-pixbuf/io-jpeg.c
+++ b/gdk-pixbuf/io-jpeg.c
@@ -699,8 +699,7 @@ gdk_pixbuf__jpeg_image_load (FILE *f, GError **error)
                      convert_cmyk_to_rgb (&cinfo, lines);
                      break;
                    default:
-                     g_object_unref (pixbuf);
-                     pixbuf = NULL;
+                     g_clear_object (&pixbuf);
                       g_set_error (error,
                                    GDK_PIXBUF_ERROR,
                                   GDK_PIXBUF_ERROR_UNKNOWN_TYPE,


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