The GdkPixbuf Library | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
#include <gdk-pixbuf/gdk-pixbuf.h> void gdk_pixbuf_ref (GdkPixbuf *pixbuf); void gdk_pixbuf_unref (GdkPixbuf *pixbuf); |
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.
void gdk_pixbuf_ref (GdkPixbuf *pixbuf); |
Adds a reference to a pixbuf. It must be released afterwards using gdk_pixbuf_unref().
pixbuf : | A pixbuf. |
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. |