GNOME Bugzilla – Bug 341857
warning fix for glade-xml.c
Last modified: 2006-07-11 13:18:49 UTC
Trying to get rid of warnings of this type: glade-xml.c: In function 'glade_xml_set_value_from_string': glade-xml.c:1519: warning: implicit declaration of function 'gtk_object_sink'
Created attachment 65501 [details] [review] proposed patch
Created attachment 65502 [details] [review] updated patch Remove some unneeded casts.
Comment on attachment 65502 [details] [review] updated patch >Index: glade-xml.c >=================================================================== >RCS file: /cvs/gnome/libglade/glade/glade-xml.c,v >retrieving revision 1.111 >diff -u -p -r1.111 glade-xml.c >--- glade-xml.c 29 Nov 2004 11:05:16 -0000 1.111 >+++ glade-xml.c 15 May 2006 13:50:13 -0000 >@@ -121,8 +121,7 @@ glade_xml_init (GladeXML *self) > priv->tree = NULL; > priv->tooltips = gtk_tooltips_new(); > gtk_tooltips_enable(priv->tooltips); >- g_object_ref(priv->tooltips); >- gtk_object_sink(GTK_OBJECT(priv->tooltips)); >+ g_object_ref_sink(priv->tooltips); > priv->name_hash = g_hash_table_new(g_str_hash, g_str_equal); > priv->signals = g_hash_table_new(g_str_hash, g_str_equal); > priv->toplevel = NULL; This looks fine. >@@ -1517,7 +1516,7 @@ glade_xml_set_value_from_string (GladeXM > adj->page_size = g_strtod(ptr, &ptr); > > g_value_set_object(value, adj); >- gtk_object_sink(GTK_OBJECT(adj)); >+ g_object_ref_sink(adj); > } else if (G_VALUE_HOLDS(value, GDK_TYPE_PIXBUF)) { > gchar *filename; > GError *error = NULL; This will leak. You need a g_object_unref(adj); call after ref_sink() to get equivalent behaviour. With that fixed, you can commit (with an appropriate changelog).
Commited with that change. Thanks.