From: Paul Eggert Date: Tue, 3 Apr 2018 15:24:10 +0000 (-0700) Subject: Work around GC+Cairo bug X-Git-Tag: emacs-27.0.90~5337 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1233bcb0a78755ec4f3a925b84c15b1c6f715b1c;p=emacs.git Work around GC+Cairo bug Workaround suggested by Robert Pluim (Bug#20890#13). * src/ftfont.c (ftfont_close) [USE_CAIRO]: Do nothing if GC is in progress. --- diff --git a/src/ftfont.c b/src/ftfont.c index 84e4a303899..fea00ffe41d 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -1245,6 +1245,12 @@ 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) + return; +#endif struct ftfont_info *ftfont_info = (struct ftfont_info *) font; Lisp_Object val, cache;