changeset 84976:372151e622f3

(load_face_font, free_realized_face, clear_face_gcs): Don't let signal handlers run when a GC is freed but not yet NULL'ed. (x_free_gc): Remove BLOCK_INPUT since it's now redundant.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 29 Sep 2007 17:50:09 +0000
parents 5596152dc0c7
children 3747382d60e9
files src/ChangeLog src/xfaces.c
diffstat 2 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sat Sep 29 16:23:59 2007 +0000
+++ b/src/ChangeLog	Sat Sep 29 17:50:09 2007 +0000
@@ -1,3 +1,9 @@
+2007-09-29  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* xfaces.c (load_face_font, free_realized_face, clear_face_gcs):
+	Don't let signal handlers run when a GC is freed but not yet NULL'ed.
+	(x_free_gc): Remove BLOCK_INPUT since it's now redundant.
+
 2007-09-28  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	* Makefile.in (lisp, shortlisp): Delete server.elc, it is not
--- a/src/xfaces.c	Sat Sep 29 16:23:59 2007 +0000
+++ b/src/xfaces.c	Sat Sep 29 17:50:09 2007 +0000
@@ -744,10 +744,9 @@
      struct frame *f;
      GC gc;
 {
-  BLOCK_INPUT;
+  eassert (interrupt_input_blocked);
   IF_DEBUG (xassert (--ngcs >= 0));
   XFreeGC (FRAME_X_DISPLAY (f), gc);
-  UNBLOCK_INPUT;
 }
 
 #endif /* HAVE_X_WINDOWS */
@@ -777,10 +776,8 @@
      struct frame *f;
      GC gc;
 {
-  BLOCK_INPUT;
   IF_DEBUG (xassert (--ngcs >= 0));
   xfree (gc);
-  UNBLOCK_INPUT;
 }
 
 #endif  /* WINDOWSNT */
@@ -807,10 +804,9 @@
      struct frame *f;
      GC gc;
 {
-  BLOCK_INPUT;
+  eassert (interrupt_input_blocked);
   IF_DEBUG (xassert (--ngcs >= 0));
   XFreeGC (FRAME_MAC_DISPLAY (f), gc);
-  UNBLOCK_INPUT;
 }
 
 #endif  /* MAC_OS */
@@ -1257,8 +1253,10 @@
       face->overstrike = needs_overstrike;
       if (face->gc)
 	{
+	  BLOCK_INPUT;
 	  x_free_gc (f, face->gc);
 	  face->gc = 0;
+	  UNBLOCK_INPUT;
 	}
     }
   else
@@ -5256,8 +5254,10 @@
 	    free_face_fontset (f, face);
 	  if (face->gc)
 	    {
+	      BLOCK_INPUT;
 	      x_free_gc (f, face->gc);
 	      face->gc = 0;
+	      UNBLOCK_INPUT;
 	    }
 
 	  free_face_colors (f, face);
@@ -5421,8 +5421,10 @@
 	  struct face *face = c->faces_by_id[i];
 	  if (face && face->gc)
 	    {
+	      BLOCK_INPUT;
 	      x_free_gc (c->f, face->gc);
 	      face->gc = 0;
+	      UNBLOCK_INPUT;
 	    }
 	}
 #endif /* HAVE_WINDOW_SYSTEM */