Pango memory leak in get_ruleset() in modules/basic/basic-fc.c


while working with the diagram editor "dia" I noticed a major memory
leak when editing text objects. I tracked this down to a problem in the
above function. From what I understand the function looks for an ruleset
associated with the given font face and in case there is none, the
ruleset is created with pango_ot_ruleset_new() and finally attached to
the font face. The g_object_unref() is given as "notification callback"
so that the ruleset is destroyed when the font face is finalized.

In theory this should work, but unfortunately it doesn't in practice,
because pango_ot_ruleset_new() internally references "info" itself, thus
creating a circular dependency that keeps the objects alive

Unfortunately I don't see an simple solution, except to drop that kind
of caching again...


P.S.: Please reply to my email address as well, as I'm not subscribed to
the list.

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