hashtable: properly handle insert() de-set-ifying
authorRyan Lortie <desrt@desrt.ca>
Wed, 30 Jan 2013 00:23:48 +0000 (01:23 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 2 Feb 2013 05:34:01 +0000 (00:34 -0500)
commitbb1df4d01b25e6e12ff30adcd3b07b37c4837bc0
tree1b9487deab709fe5764f3279b43793ff040b5933
parentb1e02c7e32b40bd9e202fd4e14f046041ae0258b
hashtable: properly handle insert() de-set-ifying

GHashTable remains a set for as long as all of the keys are exactly
equal (in pointer value) to all of the values.  We check this by
comparing keys to values when we do inserts.

Unfortunately, when doing g_hash_table_insert() when a key is already in
the table, the old key pointer value is kept, but the new value pointer
is used.  Now we have a situation where a key pointer is unequal to a
value pointer, but we were not treating this case properly.

Fix that.

https://bugzilla.gnome.org/show_bug.cgi?id=692815
glib/ghash.c