Make FcGetDefaultLang and FcGetDefaultLangs thread-safe
[platform/upstream/fontconfig.git] / src / fcstr.c
index e72be5e..f278022 100644 (file)
@@ -1234,6 +1234,10 @@ FcStrSetDestroy (FcStrSet *set)
 {
     int        i;
 
+    /* We rely on this in FcGetDefaultLangs for caching. */
+    if (FcRefIsConst (&set->ref))
+       return;
+
     if (FcRefDec (&set->ref) != 1)
        return;