if (!GTK_IS_NAMED_ACTION (action) ||
!g_str_equal (gtk_named_action_get_action_name (GTK_NAMED_ACTION (action)), action_name))
- continue;
+ {
+ g_object_unref (shortcut_i);
+ continue;
+ }
if ((target == NULL && args != NULL) ||
(target != NULL && (args == NULL || !g_variant_equal (target, args))))
- continue;
+ {
+ g_object_unref (shortcut_i);
+ continue;
+ }
g_list_store_remove (G_LIST_STORE (accels->shortcuts), i);
break;
if (!GTK_IS_NAMED_ACTION (action) ||
!g_str_equal (gtk_named_action_get_action_name (GTK_NAMED_ACTION (action)), action_name))
- continue;
+ {
+ g_object_unref (shortcut);
+ continue;
+ }
if ((target == NULL && args != NULL) ||
(target != NULL && (args == NULL || !g_variant_equal (target, args))))
- continue;
+ {
+ g_object_unref (shortcut);
+ continue;
+ }
append_accelerators (result, gtk_shortcut_get_trigger (shortcut));
+ g_object_unref (shortcut);
break;
}
}
result = g_ptr_array_new ();
-
+
for (i = 0; i < g_list_model_get_n_items (accels->shortcuts); i++)
{
GtkShortcut *shortcut = g_list_model_get_item (accels->shortcuts, i);
char *detailed_name;
if (!trigger_matches_accel (gtk_shortcut_get_trigger (shortcut), key, modifiers))
- continue;
-
+ {
+ g_object_unref (shortcut);
+ continue;
+ }
+
detailed_name = get_detailed_name_for_shortcut (shortcut);
if (detailed_name)
g_ptr_array_add (result, detailed_name);
+
+ g_object_unref (shortcut);
}
g_ptr_array_add (result, NULL);
guint i;
result = g_ptr_array_new ();
-
+
for (i = 0; i < g_list_model_get_n_items (accels->shortcuts); i++)
{
GtkShortcut *shortcut = g_list_model_get_item (accels->shortcuts, i);
detailed_name = get_detailed_name_for_shortcut (shortcut);
if (detailed_name)
g_ptr_array_add (result, detailed_name);
+
+ g_object_unref (shortcut);
}
g_ptr_array_add (result, NULL);