diff options
| author | Paul Eggert | 2018-04-04 10:59:09 -0700 |
|---|---|---|
| committer | Eli Zaretskii | 2019-01-05 11:53:04 +0200 |
| commit | 99e2ad9e4e5edeb91e739605c15dbf07f31143cc (patch) | |
| tree | e9d5314b6e0711fe1ae698c3eda5c90f71175e72 /src/ftfont.c | |
| parent | e0862eda47c549850a43f09d12882849a2073f93 (diff) | |
| download | emacs-99e2ad9e4e5edeb91e739605c15dbf07f31143cc.tar.gz emacs-99e2ad9e4e5edeb91e739605c15dbf07f31143cc.zip | |
Improve GC+Cairo workaround
Suggested by Eli Zaretskii (Bug#20890#31).
* src/font.h (font_data_structures_may_be_ill_formed): New function.
* src/ftfont.c (ftfont_close):
* src/ftcrfont.c (ftcrfont_close): Use it.
(cherry picked from commit d02fd482fbeaf6ed551e78223b538495cb0c3541)
Diffstat (limited to 'src/ftfont.c')
| -rw-r--r-- | src/ftfont.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/ftfont.c b/src/ftfont.c index bdb1dff8cb9..823fb2095ce 100644 --- a/src/ftfont.c +++ b/src/ftfont.c | |||
| @@ -1243,15 +1243,8 @@ ftfont_open (struct frame *f, Lisp_Object entity, int pixel_size) | |||
| 1243 | void | 1243 | void |
| 1244 | ftfont_close (struct font *font) | 1244 | ftfont_close (struct font *font) |
| 1245 | { | 1245 | { |
| 1246 | /* FIXME: Although this function can be called while garbage-collecting, | 1246 | if (font_data_structures_may_be_ill_formed ()) |
| 1247 | the function assumes that Lisp data structures are properly-formed. | ||
| 1248 | This invalid assumption can lead to core dumps (Bug#20890). */ | ||
| 1249 | #ifdef USE_CAIRO | ||
| 1250 | /* Although this works around Bug#20890, it is probably not the | ||
| 1251 | right thing to do. */ | ||
| 1252 | if (gc_in_progress) | ||
| 1253 | return; | 1247 | return; |
| 1254 | #endif | ||
| 1255 | 1248 | ||
| 1256 | struct ftfont_info *ftfont_info = (struct ftfont_info *) font; | 1249 | struct ftfont_info *ftfont_info = (struct ftfont_info *) font; |
| 1257 | Lisp_Object val, cache; | 1250 | Lisp_Object val, cache; |