GVariantDict must be initialized if it is used
g_auto() to avoid warnings or crashes if function
g_variant_dict_init() is called on the builder.
This macro can be used as initializer instead of an explicit zeroing a variable when declaring it and a following g_variant_dict_init(), but it cannot be assigned to a variable.
asv has to live long enough for
GVariantDict to gather
the entries from, as the gathering does not happen in the
G_VARIANT_DICT_INIT() call, but rather in functions that make sure
GVariantDict is valid. In context where the initialization
value has to be a constant expression, the only possible value of
NULL. It is still possible to call
safely with a different
asv right after the variable was
initialized with G_VARIANT_DICT_INIT().
g_autoptr(GVariant) variant = get_asv_variant (); g_auto(GVariantDict) dict = G_VARIANT_DICT_INIT (variant);
|This function is not directly available to language bindings|