Function

GObjecttype_create_instance

Declaration [src]

GTypeInstance*
g_type_create_instance (
  GType type
)

Description [src]

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 implementers 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.

This function is not directly available to language bindings.

Parameters

type

Type: GType

An instantiatable type to create an instance for.

Return value

Type: GTypeInstance

An allocated and initialized instance, subject to further treatment by the fundamental type implementation.

The data is owned by the called function.