Re: [gimp-devel] selection bug in gtk]




Ben Jackson <bjj@aracnet.com> writes:

> Since I installed gtk+970925 I've been getting warnings from FreeBSD free()
> about freeing free chunks.  Since no one else seemed to be fixing that ;-)
> I went looking for it (MALLOC_OPTIONS=A, yay) and it turns out that in
> gtkselection.c, there are several calls to g_list_remove_link that don't
> use the right calling convention.  Anything that says:
> 
> 	g_list_remove_link(A, B);
> 
> should say:
> 
> 	A = g_list_remove_link(A, B);
> 
> This was causing things like the current_selection list to never become
> empty, and the data stored in the first link to be freed repeatedly.  Also,
> calls to g_list_append followed by g_list_remove_link leak memory because
> the list node itself is never freed.  I don't know where the bug lies there
> (glib could be trivially patched to fix that but I don't know if that's what
> the authors intended).

Hmmm, looks like I didn't know how to use GLists when I wrote that
code. Sort of embarrassing... It should be:

  list = g_list_remove_link (list, node)
  g_list_free(node)

'twill be fixed. Thanks for tracking it down,

                                        Owen



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