GdkPixbuf and basic memory management?



Hi,

I'm using GdkPixbuf to load a simple texture to use in OpenGL.

GError *pix_error = NULL;
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(file, &pix_error);

glBindTexture(blah, blah);  
gluBuild2DMipmaps(blah, blah);

I'm now actually done with the image. How do I free it's memory? Do I have to free the memory? Should I use:

  g_object_unref(pixbuf);

or:
  
  g_free(pixbuf);

or something else? (I don't feel I fully understand the memory management here. Can someone please explain?)

-Øystein



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