GNOME Bugzilla – Bug 549063
gconf_entry_ref doesn't return the pointer to the reffed object
Last modified: 2010-11-30 18:42:44 UTC
According to http://library.gnome.org/devel/gconf/2.23/gconf-gconf-value.html#gconf-entry-ref gconf_entry_ref doesn't return a pointer to the reffed object. That's bad, as others, like Vala, expect and rely on it (see bug 549061) especially because g_object_ref does it: http://library.gnome.org/devel/gobject/stable/gobject-The-Base-Object-Type.html#g-object-ref So I propose to just return a pointer to the reffed object.
Created attachment 117245 [details] [review] Patch which returns a pointer on a just reffed GConfEntry
Not sure changing API like this is a good idea... * gconf is basically deprecated (in theory, if a replacement is ever finished), so it's best left sort of untouched except when really necessary. If you started touching gconf there are so many things to fix it's hard to know where to start. * more concretely: any app relying on this would silently crash when compiled on older versions, which app developers might not appreciate very much. And users might not much like having to upgrade their OS to get a new gconf just because of this. This seems like the sort of API extension that only makes sense if there are some more substantive API extensions planned also.
Hey Havoc :) As you say for yourself, GConf is still in use. And I don't think it's wrong to improve things which are in use. Also I think this change makes sense to make it easier for developer who are used to the g_object_ref behaviour. If the developer wants to use this feature (and thus force the user to upgrade their version of GConf) I don't see why he or she shouldn't. My life doesn't depend on this patch being accepted, especially as my current problem might be easily fixable in Vala, but still: I consider this a bug which should be fixed for the reasons stated above.
To be clear, I haven't touched gconf since 2003, so I'm just giving an opinion, not reviewing the patch one way or the other...
*** This bug has been marked as a duplicate of bug 629984 ***