diff options
| author | Dmitry Antipov | 2013-12-16 11:45:33 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2013-12-16 11:45:33 +0400 |
| commit | 5ae356d99130af32b51a0cd67d1933ed9e6cd20e (patch) | |
| tree | 4d68dfd538ce4a7ef56027218f5ec1582d5b73df /src/font.c | |
| parent | 2013a2f955e4dc6edf9869767e9f5d70fbf9d69c (diff) | |
| download | emacs-5ae356d99130af32b51a0cd67d1933ed9e6cd20e.tar.gz 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/font.c')
| -rw-r--r-- | src/font.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/font.c b/src/font.c index fb56b3d3fb3..db55549be8c 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -148,7 +148,27 @@ static Lisp_Object font_charset_alist; | |||
| 148 | here. */ | 148 | here. */ |
| 149 | static struct font_driver_list *font_driver_list; | 149 | static struct font_driver_list *font_driver_list; |
| 150 | 150 | ||
| 151 | 151 | #ifdef ENABLE_CHECKING | |
| 152 | |||
| 153 | /* Used to catch bogus pointers in font objects. */ | ||
| 154 | |||
| 155 | bool | ||
| 156 | valid_font_driver (struct font_driver *drv) | ||
| 157 | { | ||
| 158 | Lisp_Object tail, frame; | ||
| 159 | struct font_driver_list *fdl; | ||
| 160 | |||
| 161 | for (fdl = font_driver_list; fdl; fdl = fdl->next) | ||
| 162 | if (fdl->driver == drv) | ||
| 163 | return true; | ||
| 164 | FOR_EACH_FRAME (tail, frame) | ||
| 165 | for (fdl = XFRAME (frame)->font_driver_list; fdl; fdl = fdl->next) | ||
| 166 | if (fdl->driver == drv) | ||
| 167 | return true; | ||
| 168 | return false; | ||
| 169 | } | ||
| 170 | |||
| 171 | #endif /* ENABLE_CHECKING */ | ||
| 152 | 172 | ||
| 153 | /* Creators of font-related Lisp object. */ | 173 | /* Creators of font-related Lisp object. */ |
| 154 | 174 | ||