From 8d779ce4b3cdac796e20ca568654c0ef1c576809 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 7 Sep 2006 14:22:16 -0700 Subject: [PATCH] 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. --- src/fccache.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/fccache.c b/src/fccache.c index e4b04fc..11f88a7 100644 --- a/src/fccache.c +++ b/src/fccache.c @@ -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; } -- 2.39.2