bug 1204171 - make mai_util_add_key_event_listener return the correct listener id r=davidb

The listener id is postincremented as a subexpression of being inserted into
the hash table.  That means the key inserted into the table is 1 less than the
value returned from the function.  Which means that later attempts to remove
the returned id will fail because that hash table knows about a different id.
This commit is contained in:
Trevor Saunders 2016-09-26 09:22:55 -04:00
Родитель 4b047d6307
Коммит c5cac1582b
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -265,7 +265,8 @@ mai_util_add_key_event_listener(AtkKeySnoopFunc listener, gpointer data)
}
AtkKeySnoopFuncPointer atkKeySnoop;
atkKeySnoop.func_ptr = listener;
g_hash_table_insert(sKey_listener_list, GUINT_TO_POINTER(key++),
key++;
g_hash_table_insert(sKey_listener_list, GUINT_TO_POINTER(key),
atkKeySnoop.data);
return key;
}