mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 05:56:14 +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).
|
* with empty arrays).
|
||||||
*
|
*
|
||||||
* In the event that the parsing is successful, the resulting #GVariant
|
* 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
|
* 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.
|
* 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
|
* Officially, the language understood by the parser is "any string
|
||||||
* produced by g_variant_print()".
|
* produced by g_variant_print()".
|
||||||
*
|
*
|
||||||
* Returns: a reference to a #GVariant, or %NULL
|
* Returns: a non-floating reference to a #GVariant, or %NULL
|
||||||
**/
|
**/
|
||||||
GVariant *
|
GVariant *
|
||||||
g_variant_parse (const GVariantType *type,
|
g_variant_parse (const GVariantType *type,
|
||||||
|
Loading…
Reference in New Issue
Block a user