break;
case PROP_STATE:
- g_value_set_variant (value, g_action_get_state (action));
+ g_value_take_variant (value, g_action_get_state (action));
break;
default:
* action is stateful then the type of the return value is the type
* given by g_action_get_state_type().
*
- * Returns: (allow-none) (transfer none): the current state of the action
+ * The return value should be released with g_variant_unref() when it is
+ * no longer required.
+ *
+ * Returns: (allow-none): the current state of the action
*
* Since: 2.26
**/
{
g_return_val_if_fail (G_IS_ACTION (action), NULL);
- return action->priv->state;
+ return action->priv->state ? g_variant_ref (action->priv->state) : NULL;
}
/**