Re: memory leak in PangoLayout?



On 05/06/2011 09:28 AM, Olivier Sessink wrote:
Hi all,

valgrind reports a memory leak in the following code:

gint
widget_get_string_size(GtkWidget * widget, gchar * string)
{
PangoLayout *layout;
gint retval = -1;
layout = gtk_widget_create_pango_layout(widget, string);
if (layout != NULL) {
pango_layout_get_pixel_size(layout, &retval, NULL);
g_object_unref(G_OBJECT(layout));
}
return retval;
}

in a testcase with only this bit of code running in a loop it doesn't seem to leak memory, so that was a false positive from valgrind.

Olivier




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