Preserve consistency when removing all nodes from a hash table
authorMatthias Clasen <mclasen@redhat.com>
Fri, 27 May 2011 01:52:50 +0000 (21:52 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 27 May 2011 01:52:50 +0000 (21:52 -0400)
commit5d7b67a6c361f747c8ac32d18248cc0923fe73aa
tree46a66f6514b0776bfedd325c503c153f3f693c0e
parentb92861b5a0fd4be7b5b5e494c424b0e8d48a6b7f
Preserve consistency when removing all nodes from a hash table

During the recent refactorings of GHashTable a bug was introduced
where removing all nodes from a hash table would leave tombstones
behind, but make the counts appear like there are none.

Reported and tracked down by Carlos Garnacho,
https://bugzilla.gnome.org/show_bug.cgi?id=651141

This commit also adds a test that checks the internal consistency
of GHashTable over several insert/remove/remove-all operations.
glib/ghash.c