### Method

# GLib VariantDict init

since: 2.40

#### Declaration [src]

    void
    g_variant_dict_init (
      GVariantDict* dict,
      GVariant* from_asv
    )

#### Description [src]

Initialises a `GVariantDict` structure.

If `from_asv` is given, it is used to initialise the dictionary.

This function completely ignores the previous contents of `dict`. 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 `GVariantDict` you need to first call `g_variant_dict_clear()` in order to avoid leaking memory.

You must not call `g_variant_dict_ref()` or `g_variant_dict_unref()` on a `GVariantDict` that was initialised with this function. If you ever pass a reference to a `GVariantDict` 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_dict_new()` instead of this function.

Available since: 2.40

This method is not directly available to language bindings.

#### Parameters

`from_asv`

  Type: `GVariant`

  The initial value for `dict`.

  The argument can be `NULL`.
  The data is owned by the caller of the method.