GNOME Bugzilla – Bug 704902
Fix gjs_value_to_g_value_internal() for uninitialized enum types
Last modified: 2013-09-04 18:33:45 UTC
See patch.
Created attachment 250164 [details] [review] Fix gjs_value_to_g_value_internal() for uninitialized enum types g_type_class_peek() will fail if the type's class has never been referenced before (and we'll fail with an unhelpful error message). Call g_type_class_ref() only in that case to ensure the class structure has been initialized.
Review of attachment 250164 [details] [review]: I think we should just call g_type_class_ref() always. Also, hi!
(And do the corresponding _unref() always)
Created attachment 250165 [details] [review] Fix gjs_value_to_g_value_internal() for uninitialized enum types OK, sure ... (and hi back!)
Review of attachment 250165 [details] [review]: ::: gi/value.c @@ +474,2 @@ /* See arg.c:_gjs_enum_to_int() */ + v = g_enum_get_value(G_ENUM_CLASS(g_type_class_ref(gtype)), I assume thins should be G_ENUM_CLASS(gtype_class), not another ref...
Created attachment 250181 [details] [review] Fix gjs_value_to_g_value_internal() for uninitialized enum types Yeah ... (shouldn't hastily update patches past 3am :-( )
Review of attachment 250181 [details] [review]: Looks good.
This was pushed.
(closing given comment 8)