Re: [gtk-list] Re: memory allocation/freeing



Owen Taylor wrote:
> 
> Helge Hess <hh@mdlink.de> writes:
> 
> > Hi,
> >
> > I wonder who is considered maintaining memory with gtk.
> > eg the function
> 
> Unfortunately, for returns it depends on the function. It should
> be in the documentation, when there is documentation.
> 
> For arguments, GTK should never take ownership of the arguments,
> although it may add an extra reference count if the argument
> is a pointer to a reference counted object.
> 
> However, there are may be exceptions to this rule. I.e.,
> gtk_tooltips_set_colors() (As pointed out recently)
> These should be considered be bugs.
> 

Just a near by question. 
The function gtk_clist_set_row_data(..., gpointer data) just stores
the pointer in the clist, and if I understand you right it should
copy the "unknown" object (would need the length) or it should
take a reference counted object as parameter?

There exists a memory leak in the fileselection dialog because this
odd behavior (the clists dir_list and file_list will be populated
with data from gtk_file_selection_populate but the clist-destroy
functionality nor the file_selection-destroy functionality will
free the data in the list.

I would love to give it a try and make a patch for the problem, but
I would like some one else to say which way the problem should be
attaced?

/Mattias



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