[pango/pango2: 201/201] fixup pangofc fontmap




commit 02f64ae032dcbb146af5b84d57be8d534718ad48
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jun 10 21:32:14 2022 -0400

    fixup pangofc fontmap

 pango/pangofc-fontmap.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index 1a66acc2..cb9b733b 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -579,13 +579,19 @@ pango_fc_font_map_set_config (PangoFcFontMap *self,
 {
   g_return_if_fail (PANGO_IS_FC_FONT_MAP (self));
 
-  if (self->config)
-    FcConfigDestroy (self->config);
+  if (self->config == config && FcConfigUptoDate (config))
+    return;
+
+  if (self->config != config)
+    {
+      if (self->config)
+        FcConfigDestroy (self->config);
 
-  self->config = config;
+      self->config = config;
 
-  if (self->config)
-    FcConfigReference (self->config);
+      if (self->config)
+        FcConfigReference (self->config);
+    }
 
   pango_font_map_repopulate (PANGO_FONT_MAP (self), TRUE);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]