diff options
Diffstat (limited to 'gir/gobject-2.0.c')
-rw-r--r-- | gir/gobject-2.0.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gir/gobject-2.0.c b/gir/gobject-2.0.c index abbb1411..03257c87 100644 --- a/gir/gobject-2.0.c +++ b/gir/gobject-2.0.c @@ -4377,6 +4377,27 @@ /** + * g_type_ensure: + * @type: a #GType. + * + * Ensures that the indicated @type has been registered with the + * type system, and its _class_init() method has been run. + * + * In theory, simply calling the type's _get_type() method (or using + * the corresponding macro) is supposed take care of this. However, + * _get_type() methods are often marked %G_GNUC_CONST for performance + * reasons, even though this is technically incorrect (since + * %G_GNUC_CONST requires that the function not have side effects, + * which _get_type() methods do on the first call). As a result, if + * you write a bare call to a _get_type() macro, it may get optimized + * out by the compiler. Using g_type_ensure() guarantees that the + * type's _get_type() method is called. + * + * Since: 2.34 + */ + + +/** * g_type_free_instance: * @instance: an instance of a type. * |