diff options
| author | Gerd Moellmann | 2000-05-29 12:06:54 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-05-29 12:06:54 +0000 |
| commit | 84ec3b4b5c5cfecfbdcdb6338e23ca091cbe93e8 (patch) | |
| tree | 62606059877b93194ad31f395524cb7d8a5dc80c /src/xfaces.c | |
| parent | 869a3a147f590e9be3ac208be6588098c1841822 (diff) | |
| download | emacs-84ec3b4b5c5cfecfbdcdb6338e23ca091cbe93e8.tar.gz emacs-84ec3b4b5c5cfecfbdcdb6338e23ca091cbe93e8.zip | |
(free_realized_faces): Block/unblock input.
(free_realized_multibyte_face): Ditto.
Diffstat (limited to 'src/xfaces.c')
| -rw-r--r-- | src/xfaces.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/xfaces.c b/src/xfaces.c index d63c8212f8c..f39a2936b6e 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -4663,6 +4663,11 @@ free_realized_faces (c) | |||
| 4663 | int i, size; | 4663 | int i, size; |
| 4664 | struct frame *f = c->f; | 4664 | struct frame *f = c->f; |
| 4665 | 4665 | ||
| 4666 | /* We must block input here because we can't process X events | ||
| 4667 | safely while only some faces are freed, or when the frame's | ||
| 4668 | current matrix still references freed faces. */ | ||
| 4669 | BLOCK_INPUT; | ||
| 4670 | |||
| 4666 | for (i = 0; i < c->used; ++i) | 4671 | for (i = 0; i < c->used; ++i) |
| 4667 | { | 4672 | { |
| 4668 | free_realized_face (f, c->faces_by_id[i]); | 4673 | free_realized_face (f, c->faces_by_id[i]); |
| @@ -4682,6 +4687,8 @@ free_realized_faces (c) | |||
| 4682 | clear_current_matrices (f); | 4687 | clear_current_matrices (f); |
| 4683 | ++windows_or_buffers_changed; | 4688 | ++windows_or_buffers_changed; |
| 4684 | } | 4689 | } |
| 4690 | |||
| 4691 | UNBLOCK_INPUT; | ||
| 4685 | } | 4692 | } |
| 4686 | } | 4693 | } |
| 4687 | 4694 | ||
| @@ -4698,6 +4705,11 @@ free_realized_multibyte_face (f, fontset) | |||
| 4698 | struct face *face; | 4705 | struct face *face; |
| 4699 | int i; | 4706 | int i; |
| 4700 | 4707 | ||
| 4708 | /* We must block input here because we can't process X events safely | ||
| 4709 | while only some faces are freed, or when the frame's current | ||
| 4710 | matrix still references freed faces. */ | ||
| 4711 | BLOCK_INPUT; | ||
| 4712 | |||
| 4701 | for (i = 0; i < cache->used; i++) | 4713 | for (i = 0; i < cache->used; i++) |
| 4702 | { | 4714 | { |
| 4703 | face = cache->faces_by_id[i]; | 4715 | face = cache->faces_by_id[i]; |
| @@ -4709,11 +4721,18 @@ free_realized_multibyte_face (f, fontset) | |||
| 4709 | free_realized_face (f, face); | 4721 | free_realized_face (f, face); |
| 4710 | } | 4722 | } |
| 4711 | } | 4723 | } |
| 4724 | |||
| 4725 | /* Must do a thorough redisplay the next time. Mark current | ||
| 4726 | matrices as invalid because they will reference faces freed | ||
| 4727 | above. This function is also called when a frame is destroyed. | ||
| 4728 | In this case, the root window of F is nil. */ | ||
| 4712 | if (WINDOWP (f->root_window)) | 4729 | if (WINDOWP (f->root_window)) |
| 4713 | { | 4730 | { |
| 4714 | clear_current_matrices (f); | 4731 | clear_current_matrices (f); |
| 4715 | ++windows_or_buffers_changed; | 4732 | ++windows_or_buffers_changed; |
| 4716 | } | 4733 | } |
| 4734 | |||
| 4735 | UNBLOCK_INPUT; | ||
| 4717 | } | 4736 | } |
| 4718 | 4737 | ||
| 4719 | 4738 | ||