We're not returning a full reference for GtkNeverTrigger, but we are
returning full references for mnemonic and keyval triggers; this means
we're either going to leak mnemonic and keyval triggers if we consider
this function a "transfer none" one, or we are going to trigger an
assertion failure when finalizing a never trigger, if we consider this
function a "transfer full" one.
Let's be consistent, and always return a full reference to the caller.
* - a string parsed by gtk_accelerator_parse(), for a #GtkKeyvalTrigger
* - underscore, followed by a single character, for #GtkMnemonicTrigger
*
- * Returns: (nullable): a new #GtkShortcutTrigger or %NULL on error
+ * Returns: (nullable) (transfer full): a new #GtkShortcutTrigger
+ * or %NULL on error
*/
GtkShortcutTrigger *
gtk_shortcut_trigger_parse_string (const char *string)
g_return_val_if_fail (string != NULL, NULL);
if (g_str_equal (string, "never"))
- return gtk_never_trigger_get ();
+ return g_object_ref (gtk_never_trigger_get ());
if (string[0] == '_')
{