GNOME Bugzilla – Bug 409043
GValue cannot be used with dynamic types
Last modified: 2018-05-24 10:58:37 UTC
It is not possible to use GValue with types that are registered dynamically via the GTypePlugin interface. g_value_init() fails with the following messages: (test-value-plugin:30681): GLib-GObject-WARNING **: can't peek value table for type `CustomBoxed' which is not currently referenced (test-value-plugin:30681): GLib-GObject-WARNING **: gvalue.c:96: cannot initialize GValue with type `CustomBoxed', this type has no GTypeValueTable implementation The documentation mentions that a dynamic type can be referenced with either g_type_class_ref() or g_type_create_instance(). Unfortunately, neither of these functions can be used with boxed types.
Created attachment 82749 [details] Test case The attached test case dynamically registers a custom boxed type in order to demonstrate the bug.
I think you are right. GType never calls complete_type_info for unclassed dynamic types. At least I don't see how and when. Tim, any advice on how to fix this ?
Any ideas?
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/82.