Re: Gdkpixmap Memory leak



Thanks for your answers.

I have already proved the g_object_unref, and I still have the memory leak.
The memory increases every time that I change the xpm to my gtkpixmap.

I have proved also with gdk_drawable_unref and the memory leak remains.

Any ideas? Any help?

Thanks in advance and best regards

Boris

On Thu, 7 Aug 2003 15:54:54 -0700 (PDT)
Harring Figueiredo <harringf yahoo com> wrote:


 I believe that this rule does not apply to certain objects (widgets) added to
a container as the container will not increase the ref_count, but "sink" the
object. 

 When I add a pixmap to, say, a gtktreeview, I do, however, use the
object_unref (Which is the correct way.) I guess it is a bit confusing
(espcially to newbies like me:) to figure out when an object MUST be unref'ed
by us. Any rules ?

Harring.

--- "Pawel S. Veselov" <Pawel Veselov Sun COM> wrote:

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.
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com




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