зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
4b047d6307
Коммит
c5cac1582b
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче