Type.createInstance

Creates and initializes an instance of @type if @type is valid and can be instantiated. The type system only performs basic allocation and structure setups for instances: actual instance creation should happen through functions supplied by the type's fundamental type implementation. So use of g_type_create_instance() is reserved for implementators of fundamental types only. E.g. instances of the #GObject hierarchy should be created via g_object_new() and never directly through g_type_create_instance() which doesn't handle things like singleton objects or object construction.

The extended members of the returned instance are guaranteed to be filled with zeros.

Note: Do not use this function, unless you're implementing a fundamental type. Also language bindings should not use this function, but g_object_new() instead.

struct Type
static
createInstance

Parameters

type GType

an instantiatable type to create an instance for

Return: an allocated and initialized instance, subject to further treatment by the fundamental type implementation

Meta