mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
GObject: require READ or WRITE on property install
g_object_class_install_property() currently lets you install properties that are neither readable nor writable. Add a check to prevent that. https://bugzilla.gnome.org/show_bug.cgi?id=666616
This commit is contained in:
@@ -687,9 +687,6 @@ static void test_implementation_class_init (TestImplementationClass *class)
|
||||
if (perms[change_this_flag] == NULL)
|
||||
g_error ("Interface property does not exist");
|
||||
|
||||
if (!(use_this_flag & (G_PARAM_READABLE | G_PARAM_WRITABLE)))
|
||||
g_error ("g_object_class_install_property should probably fail here...");
|
||||
|
||||
g_snprintf (prop_name, sizeof prop_name, "%s-%s", names[change_this_type], perms[change_this_flag]);
|
||||
pspec = g_param_spec_object (prop_name, prop_name, prop_name, types[use_this_type], use_this_flag);
|
||||
g_object_class_install_property (class, 1, pspec);
|
||||
|
Reference in New Issue
Block a user