Re: Gdkpixmap Memory leak



I guess the common rule is -- if you got an object and done with it,
call g_object_unref() on it.

There are also deprecated functions that are called something_unref(),
which should not be used in favor of g_object_unref() anymore.

On Fri, Aug 08, 2003 at 12:33:28AM +0200, Boris Villazon wrote:
Hi

First, I'm sorry for my english.

I need some help.  I am creating a gtkpixmap ( I have to create a gdkpixmap first).
Later I have to change the xpm ... so I create a new gdkpixmap, but I don't know how to free the memory
of the first gdkpixmap.  I don't konw if I am very clear. I hope so.

I attach the code :

GdkColormap *colormap;
GdkPixmap *gdkpixmap;
GdkBitmap *mask;
gchar *nombre;

...

colormap = gtk_widget_get_colormap (*i6);
gdkpixmap = gdk_pixmap_colormap_create_from_xpm (NULL, colormap, &mask,NULL,nombre); //How to free this 
gdkpixmap
if(gdkpixmap == NULL)
{
      g_warning ("\nError loading pixmap file\n");
      exit(1);
}
gtk_pixmap_set(*i1,gdkpixmap,mask);
      

Does anyone know how to free a gdkpixmap?

Thanks in advance and best regards

Boris.



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