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:
Philip Withnall 2015-04-21 23:56:10 +01:00
parent c62f7a7d68
commit 1b3dbec065

View File

@ -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,