Reference patterns in FcCacheCopySet.
As patterns are put into the font set copy, mark them as referenced so the cache stays around while the font set is in use.
This commit is contained in:
parent
4c34c0c52a
commit
8d779ce4b3
|
@ -816,11 +816,16 @@ FcCacheCopySet args(const FcCache *c)
|
|||
if (!new)
|
||||
return NULL;
|
||||
for (i = 0; i < old->nfont; i++)
|
||||
if (!FcFontSetAdd (new, FcFontSetFont (old, i)))
|
||||
{
|
||||
FcPattern *font = FcFontSetFont (old, i);
|
||||
|
||||
FcPatternReference (font);
|
||||
if (!FcFontSetAdd (new, font))
|
||||
{
|
||||
FcFontSetDestroy (new);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return new;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue