From ed0c79c6fd48156b8ff578433f66764c2b68bfed Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 29 Sep 2007 17:50:09 +0000 Subject: [PATCH] (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. --- src/ChangeLog | 6 ++++++ src/xfaces.c | 14 ++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index ac56b160c88..d5ca272fe51 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2007-09-29 Stefan Monnier + + * 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 * Makefile.in (lisp, shortlisp): Delete server.elc, it is not diff --git a/src/xfaces.c b/src/xfaces.c index b1fcf28d9c3..01ac364589f 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -744,10 +744,9 @@ x_free_gc (f, gc) 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 @@ x_free_gc (f, gc) struct frame *f; GC gc; { - BLOCK_INPUT; IF_DEBUG (xassert (--ngcs >= 0)); xfree (gc); - UNBLOCK_INPUT; } #endif /* WINDOWSNT */ @@ -807,10 +804,9 @@ x_free_gc (f, gc) 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 @@ load_face_font (f, face, c) 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_realized_face (f, face) 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 @@ clear_face_gcs (c) 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 */ -- 2.39.2