[gnome-photos/wip/baedert/gtkimageview: 1/5] gegl-image: Use g_clear_pointer in finalize



commit afd6c551bd16b5f12bd176a6d9ef77266f3e0344
Author: Timm Bäder <mail baedert org>
Date:   Tue Apr 19 14:43:25 2016 +0200

    gegl-image: Use g_clear_pointer in finalize

 src/photos-gegl-image.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/src/photos-gegl-image.c b/src/photos-gegl-image.c
index 8c1c579..013907f 100644
--- a/src/photos-gegl-image.c
+++ b/src/photos-gegl-image.c
@@ -123,11 +123,8 @@ photos_gegl_image_finalize (GObject *_image)
 {
   PhotosGeglImage *image = PHOTOS_GEGL_IMAGE (_image);
 
-  if (image->surface)
-    cairo_surface_destroy (image->surface);
-
-  if (image->buf)
-    g_free (image->buf);
+  g_clear_pointer (&image->surface, cairo_surface_destroy);
+  g_clear_pointer (&image->buf, g_free);
 
   G_OBJECT_CLASS (photos_gegl_image_parent_class)->finalize (_image);
 }


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