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

Re: gEDA: gEDA/gaf 20050313 almost ready, but not released...



Hi Ales,

Ales Hvezda writes:
 > [...]
 > static gboolean
 > delete_font_set (gpointer key, gpointer value, gpointer user_data)
 > {
 >     [...]
 >     /* do not use s_delete() as tmp is not fully initialized */
 >     g_free (tmp->name);
 >     g_free (tmp);   <---- This is what valgrind is complaining about.
 >    
 >   }
 > 
 >   return TRUE;
 > }
 > 
 > Do we really need to free the hash value itself inside of the delete
 > function?

No in fact we do not need it: when the hash table is created the free
function for its values is specified (o_text_basic.nw:207). This
g_free can be removed (or remove the one in the hash table
definition). My fault, sorry.

 > I'm hoping that this is the cause of the malloc hang.

I am not familiar with valgrind: in a case of double free, does it
report the first free or the second? The one you point should be
called first.

Regards,


Patrick