summaryrefslogtreecommitdiff
path: root/src/fccharset.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@neko.keithp.com>2006-09-04 22:20:25 -0700
committerKeith Packard <keithp@neko.keithp.com>2006-09-04 22:20:25 -0700
commit9e612141df7e693ef98071f102cecb5d777ceecb (patch)
treee172c0b3e2ba993943567fffe05c35ef682f0989 /src/fccharset.c
parent8fe2104a1e5771ac8079a438fa21e00f946be8b3 (diff)
Reference count cache objects.
Caches contain patterns and character sets which are reference counted and visible to applications. Reference count the underlying cache object so that it stays around until all reference objects are no longer in use. This is less efficient than just leaving all caches around forever, but does avoid eternal size increases in case applications ever bother to actually look for changes in the font configuration.
Diffstat (limited to 'src/fccharset.c')
-rw-r--r--src/fccharset.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/fccharset.c b/src/fccharset.c
index fdff91f8..76c1530f 100644
--- a/src/fccharset.c
+++ b/src/fccharset.c
@@ -55,7 +55,10 @@ FcCharSetDestroy (FcCharSet *fcs)
int i;
if (fcs->ref == FC_REF_CONSTANT)
+ {
+ FcCacheObjectDereference (fcs);
return;
+ }
if (--fcs->ref > 0)
return;
for (i = 0; i < fcs->num; i++)
@@ -306,6 +309,8 @@ FcCharSetCopy (FcCharSet *src)
{
if (src->ref != FC_REF_CONSTANT)
src->ref++;
+ else
+ FcCacheObjectReference (src);
return src;
}