Gtk+ memory management

2011-04-11 Thread Andrey Maklakov
 Hello.
Can you help me and answer some questions about memory management in Gtk+?

Look at next function:

  1 void
  2 tbar_makemenu (gint button)
  3 {
  4   const gchar *sid;
  5   GList *list = NULL;
  6
  7   tbar_widget.menu[button] = gtk_menu_new ();
  8   if (button == SID)
  9   fdir_getext (filesdir, list);

 15   g_list_foreach (list, (GFunc) list_menu_additem, button);
 16   g_list_free_full (list, g_free);
 17   gtk_widget_show_all (tbar_widget.menu[button]);
 18   gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON
(tbar_widget.button[button]), tbar_widget.menu[button]);
 19 }

  My questions:
1) line 7 creates new GtkMenu, its child of GInitiallyUnowned, so
refcount = 1, but it is floating reference. True?
2) line 18 reference this menu with GtkMenuToolButton, so refcount =
1, and it is now not floating. True?
3) When I call this function 2nd time, and reference toolbutton with
new menu in line 18, what will happen? Old menu will get refcount = 0
and will be destroyed, or it is memory leak?
4) Will be destroyed menu items of old menu (which created in call of
g_list_foreach on line 15)?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Using GIO to get a file from a website

2011-04-11 Thread Kevin DeKorte
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

All,

I have some interesting in using GIO to get a file off a website, but I
would like to set the user-agent when I do this.

So far I have looked a libcurl and libsoup and they both seem to be able
to do that. But since GIO is part of glib, it would be nice not to add
any additional libraries.

Thanks,

Kevin
- -- 
Get my public GnuPG key from
http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x7D0BD5D1
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk2jM3cACgkQ6w2kMH0L1dE9uACfQ/ueqWaanEXOoRqo0Y0dJ/xs
l5kAn1dEG5uArFBGnf4EzRx8Pr8tKWV1
=myzX
-END PGP SIGNATURE-
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list