1
0
Fork 0

Remove the binding pool entry from the list

When removing a binding entry from the binding pool we should not
only remove it from the hash table, but also from the linked list
we use to iterate over inside the block/unblock_action() pair.
This commit is contained in:
Emmanuele Bassi 2009-01-05 16:29:49 +00:00
parent c988b7b736
commit 700b34148b

View file

@ -650,6 +650,7 @@ clutter_binding_pool_remove_action (ClutterBindingPool *pool,
ClutterModifierType modifiers) ClutterModifierType modifiers)
{ {
ClutterBindingEntry remove_entry = { 0, }; ClutterBindingEntry remove_entry = { 0, };
GSList *l;
g_return_if_fail (pool != NULL); g_return_if_fail (pool != NULL);
g_return_if_fail (key_val != 0); g_return_if_fail (key_val != 0);
@ -659,6 +660,18 @@ clutter_binding_pool_remove_action (ClutterBindingPool *pool,
remove_entry.key_val = key_val; remove_entry.key_val = key_val;
remove_entry.modifiers = modifiers; remove_entry.modifiers = modifiers;
for (l = pool->entries; l != NULL; l = l->data)
{
ClutterBindingEntry *e = l->data;
if (e->key_val == remove_entry.key_val &&
e->modifiers == remove_entry.modifiers)
{
pool->entries = g_slist_remove_link (pool->entries, l);
break;
}
}
g_hash_table_remove (pool->entries_hash, &remove_entry); g_hash_table_remove (pool->entries_hash, &remove_entry);
} }