This function is essentially the same as g_type_class_ref(),
except that the classes reference count isn’t incremented.
As a consequence, this function may return
NULL if the class
of the type passed in does not currently exist (hasn’t been
A more efficient version of
g_type_class_peek() which works only for
Increments the reference count of the class structure belonging to
type. This function will demand-create the class if it doesn’t
Registers a private structure for an instantiatable type.
deprecated: 2.58 since: 2.4
Gets the offset of the private data for instances of
This is a convenience function often needed in class initializers. It returns the class structure of the immediate parent type of the class passed in. Since derived classes hold a reference count on their parent classes as long as they are instantiated, the returned class will always exist.
Decrements the reference count of the class structure being passed in.
Once the last reference count of a class has been released, classes
may be finalized by the type system, so further dereferencing of a
class pointer after
g_type_class_unref() are invalid.
A variant of
g_type_class_unref() for use in
implementations. It unreferences a class without consulting the chain
GTypeClassCacheFuncs, avoiding the recursion which would occur otherwise.