Re: Freeing state.items GList in pango_layout_check_lines()?



Damon Chaplin <damon karuna uklinux net> writes:
> On Mon, 2005-05-02 at 17:10 +0100, Tony Graham wrote:
>> In pango_layout_check_lines() in pango/pango-layout.c, it seems to me
>> that the GList created by pango_itemize_with_base_dir():
>> 
>>       state.items = pango_itemize_with_base_dir (layout->context,
>> 						 base_dir,
>> 						 layout->text,
>> 						 start - layout->text,
>> 						 end - start,
>> 						 attrs,
>> 						 iter);
>> 
>> is not freed or otherwise unreferenced when 'state' goes out of scope.
>> 
>> Is that correct?
>
> I think the ownership of the items is implicitly taken over by the
> PangoLayoutLine/PangoLayoutRun as they are created.
>
> When the line is freed with pango_layout_line_unref() it calls
> free_run() and that calls pango_item_free().

Thanks for your response.

The reason for my question was that I was running valgrind on xmlroff,
which uses Pango, and a lot of the memory that was left as still
reachable resulted from pango_itemize_with_base_dir().  I guess I'll
have to look harder to find if, where, and how the memory can be
freed.

Regards,


Tony Graham
Sun Microsystems Ireland                           Phone: +353 1 8199708
East Point Business Park, Dublin 3                   Internal: (70)19708




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