diff options
| author | Dmitry Antipov | 2013-10-25 10:55:36 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2013-10-25 10:55:36 +0400 |
| commit | 78e0b35c45892995da596c65759fdece3e67129d (patch) | |
| tree | 4e18a2b9f5703f8eb4c7151fc061f4c13892432e /src/xfont.c | |
| parent | 963ce6361af7f8b7aefb63e7a50956e497020b12 (diff) | |
| download | emacs-78e0b35c45892995da596c65759fdece3e67129d.tar.gz emacs-78e0b35c45892995da596c65759fdece3e67129d.zip | |
Omit unused frame argument of font API's close function.
* font.h (struct font): Drop frame argument. Adjust comment.
* font.c (font_clear_cache, font_close_object): Adjust users.
* ftfont.c (ftfont_close):
* ftxfont.c (ftxfont_close):
* macfont.m (macfont_close):
* nsfont.m (nsfont_close):
* w32font.c (w32font_close):
* xfont.c (xfont_close):
* xftfont.c (xftfont_close): Adjust driver-specific close
functions, tweak comments and make functions safe if called
more than once for the same font object.
Diffstat (limited to 'src/xfont.c')
| -rw-r--r-- | src/xfont.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/xfont.c b/src/xfont.c index c5b8db3830c..1f87fb8783e 100644 --- a/src/xfont.c +++ b/src/xfont.c | |||
| @@ -119,7 +119,7 @@ static Lisp_Object xfont_list (struct frame *, Lisp_Object); | |||
| 119 | static Lisp_Object xfont_match (struct frame *, Lisp_Object); | 119 | static Lisp_Object xfont_match (struct frame *, Lisp_Object); |
| 120 | static Lisp_Object xfont_list_family (struct frame *); | 120 | static Lisp_Object xfont_list_family (struct frame *); |
| 121 | static Lisp_Object xfont_open (struct frame *, Lisp_Object, int); | 121 | static Lisp_Object xfont_open (struct frame *, Lisp_Object, int); |
| 122 | static void xfont_close (struct frame *, struct font *); | 122 | static void xfont_close (struct font *); |
| 123 | static int xfont_prepare_face (struct frame *, struct face *); | 123 | static int xfont_prepare_face (struct frame *, struct face *); |
| 124 | static int xfont_has_char (Lisp_Object, int); | 124 | static int xfont_has_char (Lisp_Object, int); |
| 125 | static unsigned xfont_encode_char (struct font *, int); | 125 | static unsigned xfont_encode_char (struct font *, int); |
| @@ -890,11 +890,17 @@ xfont_open (struct frame *f, Lisp_Object entity, int pixel_size) | |||
| 890 | } | 890 | } |
| 891 | 891 | ||
| 892 | static void | 892 | static void |
| 893 | xfont_close (struct frame *f, struct font *font) | 893 | xfont_close (struct font *font) |
| 894 | { | 894 | { |
| 895 | block_input (); | 895 | struct xfont_info *xfi = (struct xfont_info *) font; |
| 896 | XFreeFont (FRAME_X_DISPLAY (f), ((struct xfont_info *) font)->xfont); | 896 | |
| 897 | unblock_input (); | 897 | if (xfi->xfont) |
| 898 | { | ||
| 899 | block_input (); | ||
| 900 | XFreeFont (xfi->display, xfi->xfont); | ||
| 901 | unblock_input (); | ||
| 902 | xfi->xfont = NULL; | ||
| 903 | } | ||
| 898 | } | 904 | } |
| 899 | 905 | ||
| 900 | static int | 906 | static int |