Function Macro

GLibDEFINE_AUTOPTR_CLEANUP_FUNC

since: 2.44

Declaration [src]

#define G_DEFINE_AUTOPTR_CLEANUP_FUNC (
  TypeName,
  func
)

Description [src]

Defines the appropriate cleanup function for a pointer type.

The function will not be called if the variable to be cleaned up contains NULL.

This will typically be the _free() or _unref() function for the given type.

With this definition, it will be possible to use g_autoptr() with TypeName.

G_DEFINE_AUTOPTR_CLEANUP_FUNC(GObject, g_object_unref)

This macro should be used unconditionally; it is a no-op on compilers where cleanup is not supported.

Available since: 2.44

This function is not directly available to language bindings.

Parameters

TypeName

Type: -

A type name to define a g_autoptr() cleanup function for.

func

Type: -

The cleanup function.