After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 730168 - Incorrect annotation on g_action_group_get_action_state_type return value
Incorrect annotation on g_action_group_get_action_state_type return value
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gapplication
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-05-15 05:53 UTC by Evan Nemerson
Modified: 2015-06-05 17:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GActionGroup: fix an annotation (1010 bytes, patch)
2014-05-25 09:22 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Evan Nemerson 2014-05-15 05:53:25 UTC
/**
     * ...
     * Returns: (transfer full): the state type, if the action is stateful
     * ...
     **/
    const GVariantType *
    g_action_group_get_action_state_type (GActionGroup *action_group,
                                          const gchar  *action_name)


However, looking at the implementation of query_action in GDBusActionGroup:


    if (state_type)
      *state_type = info->state ? g_variant_get_type (info->state) : NULL;

    if (state_hint)
      *state_hint = NULL;

    if (state)
      *state = info->state ? g_variant_ref (info->state) : NULL;


And g_variant_get_type is pretty clear about the return value not transferring ownership.
Comment 1 Allison Karlitskaya (desrt) 2014-05-25 09:22:38 UTC
Created attachment 277139 [details] [review]
GActionGroup: fix an annotation

.get_action_state_type() does not return a copy.

We remove the annotation entirely because it is evident from the 'const'
on the return type.
Comment 2 Matthias Clasen 2015-03-29 16:43:50 UTC
Review of attachment 277139 [details] [review]:

yes
Comment 3 Matthias Clasen 2015-06-05 17:02:25 UTC
Attachment 277139 [details] pushed as eeae795 - GActionGroup: fix an annotation