Re: Possble problem with g_hash_table_remove() not resizing table
- From: NotZed <notzed helixcode com>
- To: darren seattleserver com
- Cc: gtk-devel-list gnome org
- Subject: Re: Possble problem with g_hash_table_remove() not resizing table
- Date: Wed, 31 May 2000 18:04:52 -0400 (EDT)
Looks like you're doing something wrong, you're freeing
the keys and then trying to remove the nodes based on
those keys.
The hash table just stores a pointer to your keys, so after
freeing them, they are no longer valid, so its just luck that it
normally works (and as you find, dependent on the implementation of
free()).
> g_free(ori_key);
> g_free(ori_val);
> g_hash_table_remove(table, (gpointer)&lkey);
> I would expect the table size to be zero at the end, instead it is 1208.
> Is something wrong or am I doing this wrong?
>
[
Date Prev][Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]