[glib] gvariant: Clarify return docs for g_variant_get_normal_form()
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] gvariant: Clarify return docs for g_variant_get_normal_form()
- Date: Sun, 3 Dec 2017 20:01:56 +0000 (UTC)
commit e45f99e3f64f0aadf9e4fa8c549adf33e046e215
Author: Philip Withnall <withnall endlessm com>
Date: Wed Nov 15 12:27:41 2017 +0000
gvariant: Clarify return docs for g_variant_get_normal_form()
Clarify that the return value may be floating, or may not be (depends
on whether the input @value was in normal form).
Signed-off-by: Philip Withnall <withnall endlessm com>
https://bugzilla.gnome.org/show_bug.cgi?id=741167
glib/gvariant.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/glib/gvariant.c b/glib/gvariant.c
index 98b32e7..ad1ea16 100644
--- a/glib/gvariant.c
+++ b/glib/gvariant.c
@@ -5855,6 +5855,13 @@ g_variant_deep_copy (GVariant *value)
* data from untrusted sources and you want to ensure your serialised
* output is definitely in normal form.
*
+ * If @value is already in normal form, a new reference will be returned
+ * (which will be floating if @value is floating). If it is not in normal form,
+ * the newly created #GVariant will be returned with a single non-floating
+ * reference. Typically, g_variant_take_ref() should be called on the return
+ * value from this function to guarantee ownership of a single non-floating
+ * reference to it.
+ *
* Returns: (transfer full): a trusted #GVariant
*
* Since: 2.24
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]