From: Eli Zaretskii Date: Tue, 21 Jan 2014 16:08:31 +0000 (+0200) Subject: Fix bug #16509 with segfault in an assertion when exiting due to missing font. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~310 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f7551c6c33394b4cdfb9da378aa2ea1cb2534a4e;p=emacs.git Fix bug #16509 with segfault in an assertion when exiting due to missing font. src/w32fns.c (unwind_create_frame): Avoid crashing inside assertion when the image cache is not yet allocated. --- diff --git a/src/ChangeLog b/src/ChangeLog index 99a3e7e7299..eb05786e3fa 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2014-01-21 Eli Zaretskii + + * w32fns.c (unwind_create_frame): Avoid crashing inside assertion + when the image cache is not yet allocated. (Bug#16509) + 2014-01-21 Dmitry Antipov * buffer.c (Fkill_buffer): When killing an indirect buffer, diff --git a/src/w32fns.c b/src/w32fns.c index d6f3fe7a3eb..0d965647599 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -4250,7 +4250,9 @@ unwind_create_frame (Lisp_Object frame) #ifdef GLYPH_DEBUG /* Check that reference counts are indeed correct. */ eassert (dpyinfo->reference_count == dpyinfo_refcount); - eassert (dpyinfo->terminal->image_cache->refcount == image_cache_refcount); + eassert ((dpyinfo->terminal->image_cache == NULL + && image_cache_refcount == 0) + || dpyinfo->terminal->image_cache->refcount == image_cache_refcount); #endif return Qt; }