type must be non-
NULL. It specifies the type of container to
construct. It can be an indefinite type such as
G_VARIANT_TYPE_ARRAY or a definite type such as “as” or “(ii)”.
Maybe, array, tuple, dictionary entry and variant-typed values may be constructed.
After the builder is initialised, values are added using
g_variant_builder_add_value() or g_variant_builder_add().
After all the child values are added,
the memory associated with the builder and returns the
This function completely ignores the previous contents of
On one hand this means that it is valid to pass in completely
uninitialised memory. On the other hand, this means that if you are
initialising over top of an existing
GVariantBuilder you need to
g_variant_builder_clear() in order to avoid leaking memory.
You must not call
g_variant_builder_unref() on a
GVariantBuilder that was initialised
with this function. If you ever pass a reference to a
GVariantBuilder outside of the control of your own code then you
should assume that the person receiving that reference may try to use
reference counting; you should use
g_variant_builder_new() instead of
Available since: 2.24
This method is not directly available to language bindings.
A container type.
The data is owned by the caller of the method.