diff options
Diffstat (limited to 'src/alloc.c')
-rw-r--r-- | src/alloc.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/alloc.c b/src/alloc.c index e5116acaefd..e2213db853d 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -2974,9 +2974,16 @@ cleanup_vector (struct Lisp_Vector *vector) && ((vector->header.size & PSEUDOVECTOR_SIZE_MASK) == FONT_OBJECT_MAX)) { - /* Attempt to catch subtle bugs like Bug#16140. */ - eassert (valid_font_driver (((struct font *) vector)->driver)); - ((struct font *) vector)->driver->close ((struct font *) vector); + struct font_driver *drv = ((struct font *) vector)->driver; + + /* The font driver might sometimes be NULL, e.g. if Emacs was + interrupted before it had time to set it up. */ + if (drv) + { + /* Attempt to catch subtle bugs like Bug#16140. */ + eassert (valid_font_driver (drv)); + drv->close ((struct font *) vector); + } } } |