summaryrefslogtreecommitdiff
path: root/glib/ghash.c
diff options
context:
space:
mode:
authorRyan Lortie <ryanl@src.gnome.org>2007-11-28 03:58:08 +0000
committerRyan Lortie <ryanl@src.gnome.org>2007-11-28 03:58:08 +0000
commit5e02b01b210513c19b76731d303a7256d2db273c (patch)
tree3d26474d6553697e3335edf5862ae420eb3be540 /glib/ghash.c
parent0adbacbff90cdab1b96e3409b6d510a00916b586 (diff)
downloadglib-5e02b01b210513c19b76731d303a7256d2db273c.tar.gz
nothing to see here... move along, move along :)
svn path=/trunk/; revision=5965
Diffstat (limited to 'glib/ghash.c')
-rw-r--r--glib/ghash.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/glib/ghash.c b/glib/ghash.c
index f65bebcce..cee769153 100644
--- a/glib/ghash.c
+++ b/glib/ghash.c
@@ -338,11 +338,15 @@ g_hash_table_insert_internal (GHashTable *hash_table,
if (*node)
{
- if (hash_table->key_destroy_func)
+ if (keep_new_key)
{
- if (keep_new_key)
+ if (hash_table->key_destroy_func)
hash_table->key_destroy_func ((*node)->key);
- else
+ (*node)->key = key;
+ }
+ else
+ {
+ if (hash_table->key_destroy_func)
hash_table->key_destroy_func (key);
}