Return a bool from pixman_image_unref. pixman-0.9.4
authorAaron Plattner <aplattner@nvidia.com>
Wed, 1 Aug 2007 21:16:55 +0000 (14:16 -0700)
committerAaron Plattner <aplattner@nvidia.com>
Mon, 6 Aug 2007 21:53:57 +0000 (14:53 -0700)
Returns TRUE when the refcount reaches 0 and the image is freed.

pixman/pixman-image.c
pixman/pixman.h

index ca186a3..2cbf88c 100644 (file)
@@ -106,7 +106,8 @@ pixman_image_ref (pixman_image_t *image)
     return image;
 }
 
-void
+/* returns TRUE when the image is freed */
+pixman_bool_t
 pixman_image_unref (pixman_image_t *image)
 {
     image_common_t *common = (image_common_t *)image;
@@ -146,7 +147,11 @@ pixman_image_unref (pixman_image_t *image)
            free (image->bits.free_me);
        
        free (image);
+
+       return TRUE;
     }
+
+    return FALSE;
 }
 
 /* Constructors */
index 74358e0..ae5aa7a 100644 (file)
@@ -451,7 +451,7 @@ pixman_image_t *pixman_image_create_bits             (pixman_format_code_t
 
 /* Destructor */
 pixman_image_t *pixman_image_ref                     (pixman_image_t               *image);
-void            pixman_image_unref                   (pixman_image_t               *image);
+pixman_bool_t   pixman_image_unref                   (pixman_image_t               *image);
 
 
 /* Set properties */