[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtk-app-devel
Subject:    Re: Size of text
From:       François-Xavier_Coudert <Francois-Xavier.Coudert () ens ! fr>
Date:       2003-04-25 3:45:38
[Download RAW message or body]

> (Remember to call pango_attr_list_unref() after
> pango_Layout_set_attributes())

The following code:

  p_layout = gtk_widget_create_pango_layout (drawing_area, atom->text);
  p_list = pango_attr_list_new ();
  p_attr = pango_attr_size_new ((int) (10000 * zoom));
  p_attr->start_index = 0;
  p_attr->end_index = strlen (atom->text);
  pango_attr_list_insert (p_list, p_attr);
  pango_layout_set_attributes (p_layout, p_list);
  pango_layout_get_pixel_size (p_layout, &width, &height);

  pango_attr_list_unref (p_list);

used a big number of times, is reported by memprof to have memory leaks,
becoming annoying, of size:

 1 for pango_layout_set_tex
12 for pango_attr_list_new

I do not understand, because

 - the list is unref'ed every time
 - I don't see any unref function for layouts and attributes, is it
   normal?

If you have an idea,
Thanks

-- 
François-Xavier Coudert
École normale supérieure
45, rue d'Ulm - 75005 Paris
<Francois-Xavier.Coudert@ens.fr>
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic