diff options
| author | Paul Eggert | 2018-04-04 10:59:09 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-04-04 10:59:53 -0700 |
| commit | d02fd482fbeaf6ed551e78223b538495cb0c3541 (patch) | |
| tree | 3e4f5f3b468b8208808c2ac2bc068fbae56ff235 /src/ftfont.c | |
| parent | 2f779d8ce804de84fed55a6b0aa74499ef369852 (diff) | |
| download | emacs-d02fd482fbeaf6ed551e78223b538495cb0c3541.tar.gz emacs-d02fd482fbeaf6ed551e78223b538495cb0c3541.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.
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 51b04a86829..9a8777ef078 100644 --- a/src/ftfont.c +++ b/src/ftfont.c | |||
| @@ -1242,15 +1242,8 @@ ftfont_open (struct frame *f, Lisp_Object entity, int pixel_size) | |||
| 1242 | void | 1242 | void |
| 1243 | ftfont_close (struct font *font) | 1243 | ftfont_close (struct font *font) |
| 1244 | { | 1244 | { |
| 1245 | /* FIXME: Although this function can be called while garbage-collecting, | 1245 | if (font_data_structures_may_be_ill_formed ()) |
| 1246 | the function assumes that Lisp data structures are properly-formed. | ||
| 1247 | This invalid assumption can lead to core dumps (Bug#20890). */ | ||
| 1248 | #ifdef USE_CAIRO | ||
| 1249 | /* Although this works around Bug#20890, it is probably not the | ||
| 1250 | right thing to do. */ | ||
| 1251 | if (gc_in_progress) | ||
| 1252 | return; | 1246 | return; |
| 1253 | #endif | ||
| 1254 | 1247 | ||
| 1255 | struct ftfont_info *ftfont_info = (struct ftfont_info *) font; | 1248 | struct ftfont_info *ftfont_info = (struct ftfont_info *) font; |
| 1256 | Lisp_Object val, cache; | 1249 | Lisp_Object val, cache; |