Re: gdk-pixbuf merge



On Wednesday, May 03, 2000, Miguel de Icaza <miguel@helixcode.com> wrote:
> 
> My humble opinion is that this has gone beyond abstraction, and beyond
> bloatedness for the sake of hiding the "refcount".  I am sorry, but
> this seems pretty stupid to me.  Lets just put the ref_count back into
> the public structure and get this over with.

Why not just return the new refcount from gdk_pixbuf_unref()?  Seems a
lot simpler and cleaner than the current approach.  Is there some reason
this wasn't considered before?

Index: gdk-pixbuf/gdk-pixbuf.c
===================================================================
RCS file: /cvs/gnome/gdk-pixbuf/gdk-pixbuf/gdk-pixbuf.c,v
retrieving revision 1.32
diff -u -r1.32 gdk-pixbuf.c
--- gdk-pixbuf/gdk-pixbuf.c	2000/04/13 01:18:41	1.32
+++ gdk-pixbuf/gdk-pixbuf.c	2000/05/04 14:06:58
@@ -60,8 +60,10 @@
  * has been defined, then the pixbuf will be finalized.
  *
  * See also: gdk_pixbuf_set_last_unref_handler().
+ *
+ * Return value: The new refcount.
  **/
-void
+gint
 gdk_pixbuf_unref (GdkPixbuf *pixbuf)
 {
 	g_return_if_fail (pixbuf != NULL);
@@ -73,6 +75,8 @@
 		(* pixbuf->last_unref_fn) (pixbuf, pixbuf->last_unref_fn_data);
 	else
 		gdk_pixbuf_finalize (pixbuf);
+
+	return pixbuf->ref_count;
 }
 
 /**

John

-- 
dusk@ravendusk.org                                http://www.gnome.org
jsheets@codeweavers.com                      http://www.worldforge.org




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