]> git.wh0rd.org - fontconfig.git/blobdiff - src/fccache.c
Merge branch 'jhcloos'
[fontconfig.git] / src / fccache.c
index 77a303d77a044e59bedb6a3ba70e0e030115aca5..11f88a788b2dc84ab5361055aac44f638924ffd7 100644 (file)
@@ -331,7 +331,6 @@ FcCacheRemove (FcCache *cache)
         update[i] = &next[i];
     }
     s = next[0];
-    assert (s->cache == cache);
     for (i = 0; i < fcCacheMaxLevel && *update[i] == s; i++)
        *update[i] = s->next[i];
     while (fcCacheMaxLevel > 0 && fcCacheChains[fcCacheMaxLevel - 1] == NULL)
@@ -348,7 +347,10 @@ FcCacheFindByStat (struct stat *cache_stat)
        if (s->cache_dev == cache_stat->st_dev &&
            s->cache_ino == cache_stat->st_ino &&
            s->cache_mtime == cache_stat->st_mtime)
+       {
+           s->ref++;
            return s->cache;
+       }
     return NULL;
 }
 
@@ -814,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;
 }
 
@@ -1083,3 +1090,6 @@ static void MD5Transform(FcChar32 buf[4], FcChar32 in[16])
     buf[2] += c;
     buf[3] += d;
 }
+#define __fccache__
+#include "fcaliastail.h"
+#undef __fccache__