<p dir="ltr">On Feb 14, 2014 5:12 PM, "mathog" <<a href="mailto:mathog@caltech.edu">mathog@caltech.edu</a>> wrote:<br>
><br>
> On 14-Feb-2014 11:47, mathog wrote:<br>
>><br>
>> I'm thinking it will probably come down to building a debug version of<br>
>> fontconfig, linking with that, and then tracking a whole lot of<br>
>> pointers.<br>
><br>
><br>
>  The bad news: Inkscape still can't run FcFini() just before exit without crashing.</p>
<p dir="ltr">Try:</p>
<p dir="ltr">  pango_cairo_font_map_set_default (NULL);<br>
  cairo_debug_reset_static_data ();<br>
  FcFini ();</p>
<p dir="ltr">(On cell phone.)</p>
<p dir="ltr">behdad<br>
><br>
> Ran inkscape in valgrind while it was linked with the 2.11 library compiled with -g, and traced a huge number of memory leaks into FcValueSave.  These 3 lines leak when that function is called from numerous locations:<br>

><br>
>         v.u.s = FcStrdup (v.u.s);<br>
>         v.u.m = FcMatrixCopy (v.u.m);<br>
>         v.u.l = FcLangSetCopy (v.u.l);<br>
><br>
> but this one doesn't<br>
><br>
>         v.u.c = FcCharSetCopy ((FcCharSet *) v.u.c);<br>
><br>
> What is this code trying to do?  Because in general<br>
><br>
>    sometype var;<br>
>    /* set the values in var */<br>
>    var = duplicate_function(var);<br>
><br>
> is going to leak if sometype has pointers to memory.  The surprising thing here is not that the 3 lines noted leak, but that FcCharSetCopy doesn't.  FcValueSave is called from 4 locations in fcpat.c, and all of them leaked.  The only other place FcValueSave seemed to be used was in fccfg.c, but that included fcaliastail.h, which redefines FcValueSave so that the function by that name is not called.<br>

><br>
> Regards,<br>
><br>
><br>
> David Mathog<br>
> <a href="mailto:mathog@caltech.edu">mathog@caltech.edu</a><br>
> Manager, Sequence Analysis Facility, Biology Division, Caltech<br>
> _______________________________________________<br>
> Fontconfig mailing list<br>
> <a href="mailto:Fontconfig@lists.freedesktop.org">Fontconfig@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/fontconfig">http://lists.freedesktop.org/mailman/listinfo/fontconfig</a><br>
</p>