Reference Counting

Name

Reference Counting -- Functions to perform reference counting on a GdkPixbuf.

Synopsis


#include <gdk-pixbuf/gdk-pixbuf.h>


GdkPixbuf*  gdk_pixbuf_ref                  (GdkPixbuf *pixbuf);
void        gdk_pixbuf_unref                (GdkPixbuf *pixbuf);

Description

GdkPixbuf structures are reference counted. This means that an application can share a single pixbuf among many parts of the code. When a piece of the program needs to keep a pointer to a pixbuf, it should add a reference to it. When it no longer needs the pixbuf, it should subtract a reference. The pixbuf will be destroyed when its reference count drops to zero. Newly-created GdkPixbuf structures start with a reference count of one.

Details

gdk_pixbuf_ref ()

GdkPixbuf*  gdk_pixbuf_ref                  (GdkPixbuf *pixbuf);

Adds a reference to a pixbuf. It must be released afterwards using gdk_pixbuf_unref().

pixbuf : A pixbuf.
Returns : The same as the pixbuf argument.


gdk_pixbuf_unref ()

void        gdk_pixbuf_unref                (GdkPixbuf *pixbuf);

Removes a reference from a pixbuf. It will be destroyed when the reference count drops to zero.

pixbuf : A pixbuf.

See Also

GdkPixbuf, ArtPixBuf