summaryrefslogtreecommitdiff
path: root/src/fccache.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@neko.keithp.com>2006-09-04 23:19:59 -0700
committerKeith Packard <keithp@neko.keithp.com>2006-09-04 23:19:59 -0700
commit323ecd0cd3b8eeb50c4af87d57f2ea7b19f37215 (patch)
treeacd6973748fb01dc6ec247a1ed2d4d2d925e3c24 /src/fccache.c
parentafe5a6716058e4b952a6ec1ab3f328a1c069a8c4 (diff)
Correct reference count when sharing cache file objects.
Multiple maps of the same cache file share the same mapped object; bump the cache object reference count in this case
Diffstat (limited to 'src/fccache.c')
-rw-r--r--src/fccache.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/fccache.c b/src/fccache.c
index 77a303d7..32c36bd4 100644
--- a/src/fccache.c
+++ b/src/fccache.c
@@ -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;
}