changeset 2875:cd410e9ac4ab

* xfaces.c (free_frame_faces): Don't free the resources from the first two faces.
author Jim Blandy <jimb@redhat.com>
date Tue, 18 May 1993 22:46:17 +0000
parents 80805283464a
children ba7f0ad9aad9
files src/xfaces.c
diffstat 1 files changed, 6 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfaces.c	Tue May 18 22:45:53 1993 +0000
+++ b/src/xfaces.c	Tue May 18 22:46:17 1993 +0000
@@ -435,7 +435,7 @@
     face->gc         = f->display.x->normal_gc;
     face->foreground = gcv.foreground;
     face->background = gcv.background;
-    face->font       = XQueryFont (x_current_display, gcv.font);
+    face->font       = f->display.x->font;
     face->stipple = 0;
     face->underline = 0;
   }
@@ -450,47 +450,12 @@
     face->gc         = f->display.x->reverse_gc;
     face->foreground = gcv.foreground;
     face->background = gcv.background;
-    face->font       = XQueryFont (x_current_display, gcv.font);
+    face->font       = f->display.x->font;
     face->stipple = 0;
     face->underline = 0;
   }
 }
 
-#if 0
-void
-init_frame_faces (f)
-     struct frame *f;
-{
-  struct frame *other_frame = 0;
-  Lisp_Object rest;
-
-  for (rest = Vframe_list; !NILP (rest); rest = Fcdr (rest))
-    {
-      struct frame *f2 = XFRAME (Fcar (rest));
-      if (f2 != f && FRAME_X_P (f2))
-	{
-	  other_frame = f2;
-	  break;
-	}
-    }
-
-  if (other_frame)
-    {
-      /* Make sure this frame's face vector is as big as the others.  */
-      FRAME_N_FACES (f) = FRAME_N_FACES (other_frame);
-      FRAME_FACES (f)
-	= (struct face **) xmalloc (FRAME_N_FACES (f) * sizeof (struct face *));
-
-      /* Make sure the frame has the two basic faces.  */
-      FRAME_DEFAULT_FACE (f)
-	= copy_face (FRAME_DEFAULT_FACE (other_frame));
-      FRAME_MODE_LINE_FACE (f)
-	= copy_face (FRAME_MODE_LINE_FACE (other_frame));
-    }
-}
-#endif
-
-
 /* Called from Fdelete_frame.  */
 void
 free_frame_faces (f)
@@ -499,7 +464,10 @@
   Display *dpy = x_current_display;
   int i;
 
-  for (i = 0; i < FRAME_N_FACES (f); i++)
+  /* The first two faces on the frame are just made of resources which 
+     we borrowed from the frame's GC's, so don't free them.  Let
+     them get freed by the x_destroy_window code.  */
+  for (i = 2; i < FRAME_N_FACES (f); i++)
     {
       struct face *face = FRAME_FACES (f) [i];
       if (! face)