diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2018-04-04 10:59:09 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 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.tar.bz2 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) void ftfont_close (struct font *font) { - /* FIXME: Although this function can be called while garbage-collecting, - the function assumes that Lisp data structures are properly-formed. - This invalid assumption can lead to core dumps (Bug#20890). */ -#ifdef USE_CAIRO - /* Although this works around Bug#20890, it is probably not the - right thing to do. */ - if (gc_in_progress) + if (font_data_structures_may_be_ill_formed ()) return; -#endif struct ftfont_info *ftfont_info = (struct ftfont_info *) font; Lisp_Object val, cache; |