diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2013-12-16 11:45:33 +0400 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2013-12-16 11:45:33 +0400 |
commit | 5ae356d99130af32b51a0cd67d1933ed9e6cd20e (patch) | |
tree | 4d68dfd538ce4a7ef56027218f5ec1582d5b73df /src/alloc.c | |
parent | 2013a2f955e4dc6edf9869767e9f5d70fbf9d69c (diff) | |
download | emacs-5ae356d99130af32b51a0cd67d1933ed9e6cd20e.tar.gz emacs-5ae356d99130af32b51a0cd67d1933ed9e6cd20e.tar.bz2 emacs-5ae356d99130af32b51a0cd67d1933ed9e6cd20e.zip |
* font.c (valid_font_driver) [ENABLE_CHECKING]: New function
intended to find bogus pointers in font objects (Bug#16140).
* font.h (valid_font_driver) [ENABLE_CHECKING]: Add prototype.
* alloc.c (cleanup_vector): Use valid_font_driver in eassert.
(compact_font_cache_entry, compact_font_caches) [!HAVE_NTGUI]:
Disable for MS-Windows due to Bug#15876; apparently this
requires more or less substantial changes in fontset code.
* xfont.c (xfont_close):
* xftfont.c (xftfont_close): Call x_display_info_for_display
to check whether 'Display *' is valid (Bug#16093 and probably
Bug#16069).
Diffstat (limited to 'src/alloc.c')
-rw-r--r-- | src/alloc.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/alloc.c b/src/alloc.c index aeda42637cd..447b465a076 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -2877,7 +2877,11 @@ cleanup_vector (struct Lisp_Vector *vector) if (PSEUDOVECTOR_TYPEP (&vector->header, PVEC_FONT) && ((vector->header.size & PSEUDOVECTOR_SIZE_MASK) == FONT_OBJECT_MAX)) - ((struct font *) vector)->driver->close ((struct font *) vector); + { + /* Attempt to catch subtle bugs like Bug#16140. */ + eassert (valid_font_driver (((struct font *) vector)->driver)); + ((struct font *) vector)->driver->close ((struct font *) vector); + } } /* Reclaim space used by unmarked vectors. */ @@ -5299,6 +5303,10 @@ total_bytes_of_live_objects (void) #ifdef HAVE_WINDOW_SYSTEM +/* This code has a few issues on MS-Windows, see Bug#15876 and Bug#16140. */ + +#if !defined (HAVE_NTGUI) + /* Remove unmarked font-spec and font-entity objects from ENTRY, which is (DRIVER-TYPE NUM-FRAMES FONT-CACHE-DATA ...), and return changed entry. */ @@ -5337,6 +5345,8 @@ compact_font_cache_entry (Lisp_Object entry) return entry; } +#endif /* not HAVE_NTGUI */ + /* Compact font caches on all terminals and mark everything which is still here after compaction. */ @@ -5348,7 +5358,7 @@ compact_font_caches (void) for (t = terminal_list; t; t = t->next_terminal) { Lisp_Object cache = TERMINAL_FONT_CACHE (t); - +#if !defined (HAVE_NTGUI) if (CONSP (cache)) { Lisp_Object entry; @@ -5356,6 +5366,7 @@ compact_font_caches (void) for (entry = XCDR (cache); CONSP (entry); entry = XCDR (entry)) XSETCAR (entry, compact_font_cache_entry (XCAR (entry))); } +#endif /* not HAVE_NTGUI */ mark_object (cache); } } |