changeset 90806:1ae136ad0ba0

(free_realized_fontsets): Avoid unnecessary call of Fclear_face_cache.
author Kenichi Handa <handa@m17n.org>
date Tue, 17 Apr 2007 08:14:39 +0000
parents 50209b69d25f
children 5827fc568d23
files src/fontset.c
diffstat 1 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/fontset.c	Tue Apr 17 08:14:08 2007 +0000
+++ b/src/fontset.c	Tue Apr 17 08:14:39 2007 +0000
@@ -1397,9 +1397,9 @@
 free_realized_fontsets (base)
      Lisp_Object base;
 {
-#if 0
   int id;
 
+#if 0
   /* For the moment, this doesn't work because free_realized_face
      doesn't remove FACE from a cache.  Until we find a solution, we
      suppress this code, and simply use Fclear_face_cache even though
@@ -1427,7 +1427,18 @@
     }
   UNBLOCK_INPUT;
 #else  /* not 0 */
-  Fclear_face_cache (Qt);
+  /* But, we don't have to call Fclear_face_cache if no fontset has
+     been realized from BASE.  */
+  for (id = 0; id < ASIZE (Vfontset_table); id++)
+    {
+      Lisp_Object this = AREF (Vfontset_table, id);
+
+      if (EQ (FONTSET_BASE (this), base))
+	{
+	  Fclear_face_cache (Qt);
+	  break;
+	}
+    }
 #endif /* not 0 */
 }