Re: Possible GHashTable bug?



On Wed, Jul 04, 2001 at 04:33:31PM -0700, Derek Simkowiak wrote:
> 	I'm having trouble with a GHashTable, I don't know if it's a bug
> or just improper usage on my part.  My interpretation of the documentation
> is that it's a bug.
> 
> 	In short: Calling g_hash_table_remove() from within a
> g_hash_table_foreach() causes the next iteration of your GHFunc to get
> called with a garbage value.
> 
> 	I'm guessing there's a missing freeze/thaw in
> g_hash_table_foreach()....?

Another solution is to remove the call to g_hash_table_remove() in your
unref_entity function; 
g_hash_table_destroy() handles removing all of the keys.

-- 
Evan Martin - martine speakeasy org
 http://www.speakeasy.org/~martine




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]