diff options
author | Adel Gadllah <adel.gadllah@gmail.com> | 2010-09-21 21:57:16 +0200 |
---|---|---|
committer | Adel Gadllah <adel.gadllah@gmail.com> | 2010-09-21 22:03:25 +0200 |
commit | a612aad7fcf817d6174505e8ac519e6a554d15d3 (patch) | |
tree | edbcc266e1b1e8ef75a1c9523e90b29c6dd45262 | |
parent | 7b592dfe6c3f19a2ce160fcbd07b4e1fbd892c7d (diff) | |
download | gconf-a612aad7fcf817d6174505e8ac519e6a554d15d3.tar.gz |
Return the refernced objects in _ref
Both gconf_entry_ref() and gconf_change_set_ref() don't return
the referenced objects but nothing (void), which causes issues for
g_boxed_copy which uses the return value.
https://bugzilla.gnome.org/show_bug.cgi?id=629984
-rw-r--r-- | doc/gconf/tmpl/gconf-changeset.sgml | 1 | ||||
-rw-r--r-- | doc/gconf/tmpl/gconf-value.sgml | 1 | ||||
-rw-r--r-- | gconf/gconf-changeset.c | 4 | ||||
-rw-r--r-- | gconf/gconf-changeset.h | 2 | ||||
-rw-r--r-- | gconf/gconf-value.c | 4 | ||||
-rw-r--r-- | gconf/gconf-value.h | 2 |
6 files changed, 10 insertions, 4 deletions
diff --git a/doc/gconf/tmpl/gconf-changeset.sgml b/doc/gconf/tmpl/gconf-changeset.sgml index af33f9a5..ff8b4339 100644 --- a/doc/gconf/tmpl/gconf-changeset.sgml +++ b/doc/gconf/tmpl/gconf-changeset.sgml @@ -136,6 +136,7 @@ Increases the reference count of a #GConfChangeSet by one. </para> @cs: a #GConfChangeSet. +@Returns: the referenced #GConfChangeSet. <!-- ##### FUNCTION gconf_change_set_unref ##### --> diff --git a/doc/gconf/tmpl/gconf-value.sgml b/doc/gconf/tmpl/gconf-value.sgml index 91d67983..4a60684f 100644 --- a/doc/gconf/tmpl/gconf-value.sgml +++ b/doc/gconf/tmpl/gconf-value.sgml @@ -599,6 +599,7 @@ Increases the refcount of a #GConfEntry by one. </para> @entry: a #GConfEntry. +@Returns: the referenced #GConfEntry. <!-- ##### FUNCTION gconf_entry_unref ##### --> diff --git a/gconf/gconf-changeset.c b/gconf/gconf-changeset.c index 4890fce7..e27f1df7 100644 --- a/gconf/gconf-changeset.c +++ b/gconf/gconf-changeset.c @@ -77,12 +77,14 @@ gconf_change_set_new (void) return cs; } -void +GConfChangeSet* gconf_change_set_ref (GConfChangeSet* cs) { g_return_if_fail(cs != NULL); cs->refcount += 1; + + return cs; } void diff --git a/gconf/gconf-changeset.h b/gconf/gconf-changeset.h index 33f2a8a9..b6f1dba1 100644 --- a/gconf/gconf-changeset.h +++ b/gconf/gconf-changeset.h @@ -70,7 +70,7 @@ GConfChangeSet* gconf_engine_change_set_from_current (GConfEngine* conf, GType gconf_change_set_get_type (void); GConfChangeSet* gconf_change_set_new (void); -void gconf_change_set_ref (GConfChangeSet* cs); +GConfChangeSet* gconf_change_set_ref (GConfChangeSet* cs); void gconf_change_set_unref (GConfChangeSet* cs); diff --git a/gconf/gconf-value.c b/gconf/gconf-value.c index da9d7435..de42f752 100644 --- a/gconf/gconf-value.c +++ b/gconf/gconf-value.c @@ -1501,12 +1501,14 @@ gconf_entry_new_nocopy (char* key, GConfValue* val) return (GConfEntry*) real; } -void +GConfEntry * gconf_entry_ref (GConfEntry *entry) { g_return_if_fail (entry != NULL); REAL_ENTRY (entry)->refcount += 1; + + return entry; } void diff --git a/gconf/gconf-value.h b/gconf/gconf-value.h index d8d3c82e..5b37b841 100644 --- a/gconf/gconf-value.h +++ b/gconf/gconf-value.h @@ -186,7 +186,7 @@ GConfEntry* gconf_entry_copy (const GConfEntry *src); #ifndef GCONF_DISABLE_DEPRECATED void gconf_entry_free (GConfEntry *entry); #endif -void gconf_entry_ref (GConfEntry *entry); +GConfEntry* gconf_entry_ref (GConfEntry *entry); void gconf_entry_unref (GConfEntry *entry); /* Transfer ownership of value to the caller. */ |