GNOME Bugzilla – Bug 696424
GSimpleAction.state property is not right
Last modified: 2013-10-29 01:14:42 UTC
The 'state' property on GSimpleAction is a non-construct writable property. The set_property() function looks like so: case PROP_STATE: action->state = g_value_dup_variant (value); break; There are at least 3 problems here: - does not free the old value (probably because I thought it was construct-only when I implemented it) - does not do checks to make sure we are not changing the state type - probably state should be a construct property because during construction is the only time you should be allowed to set the state and be free of type checks
Created attachment 258354 [details] [review] GSimpleAction: don't allow changing state type g_object_set() allowed us to bypass the usual checks that the state doesn't change type and also leaked. Fix that up by turning the state into a construct property (so that it always gets set once during construction, even if only to NULL) and then route the further sets through the C API so that they are subject to the same checks.
Review of attachment 258354 [details] [review]: Ok.