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/font.h | |
| 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/font.h')
| -rw-r--r-- | src/font.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/font.h b/src/font.h index d88c8eb4f66..469431fee67 100644 --- a/src/font.h +++ b/src/font.h | |||
| @@ -945,6 +945,22 @@ extern void font_deferred_log (const char *, Lisp_Object, Lisp_Object); | |||
| 945 | font_deferred_log ((ACTION), (ARG), (RESULT)); \ | 945 | font_deferred_log ((ACTION), (ARG), (RESULT)); \ |
| 946 | } while (false) | 946 | } while (false) |
| 947 | 947 | ||
| 948 | /* FIXME: This is for use in functions that can be called while | ||
| 949 | garbage-collecting, but which assume that Lisp data structures are | ||
| 950 | properly-formed. This invalid assumption can lead to core dumps | ||
| 951 | (Bug#20890). */ | ||
| 952 | INLINE bool | ||
| 953 | font_data_structures_may_be_ill_formed (void) | ||
| 954 | { | ||
| 955 | #ifdef USE_CAIRO | ||
| 956 | /* Although this works around Bug#20890, it is probably not the | ||
| 957 | right thing to do. */ | ||
| 958 | return gc_in_progress; | ||
| 959 | #else | ||
| 960 | return false; | ||
| 961 | #endif | ||
| 962 | } | ||
| 963 | |||
| 948 | INLINE_HEADER_END | 964 | INLINE_HEADER_END |
| 949 | 965 | ||
| 950 | #endif /* not EMACS_FONT_H */ | 966 | #endif /* not EMACS_FONT_H */ |