mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 21:16:15 +01:00
gvariant-parser: Clarify g_variant_parse() returns a non-floating ref
Unlike, say, g_variant_new(), which returns a floating reference. g_variant_parse() returns a non-floating one, so must always have g_variant_unref() called on the result.
This commit is contained in:
parent
c62f7a7d68
commit
1b3dbec065
@ -2346,7 +2346,8 @@ parse (TokenStream *stream,
|
||||
* with empty arrays).
|
||||
*
|
||||
* In the event that the parsing is successful, the resulting #GVariant
|
||||
* is returned.
|
||||
* is returned. It is never floating, and must be freed with
|
||||
* g_variant_unref().
|
||||
*
|
||||
* In case of any error, %NULL will be returned. If @error is non-%NULL
|
||||
* then it will be set to reflect the error that occurred.
|
||||
@ -2354,7 +2355,7 @@ parse (TokenStream *stream,
|
||||
* Officially, the language understood by the parser is "any string
|
||||
* produced by g_variant_print()".
|
||||
*
|
||||
* Returns: a reference to a #GVariant, or %NULL
|
||||
* Returns: a non-floating reference to a #GVariant, or %NULL
|
||||
**/
|
||||
GVariant *
|
||||
g_variant_parse (const GVariantType *type,
|
||||
|
Loading…
Reference in New Issue
Block a user