aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xftfont.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/xftfont.c b/src/xftfont.c
index 7f301c69236..842f3873c49 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -362,8 +362,15 @@ xftfont_prepare_face (f, face)
362 FRAME_PTR f; 362 FRAME_PTR f;
363 struct face *face; 363 struct face *face;
364{ 364{
365 struct xftface_info *xftface_info = malloc (sizeof (struct xftface_info)); 365 struct xftface_info *xftface_info;
366 366
367 if (face != face->ascii_face)
368 {
369 face->extra = face->ascii_face->extra;
370 return 0;
371 }
372
373 xftface_info = malloc (sizeof (struct xftface_info));
367 if (! xftface_info) 374 if (! xftface_info)
368 return -1; 375 return -1;
369 376
@@ -385,16 +392,18 @@ xftfont_done_face (f, face)
385 FRAME_PTR f; 392 FRAME_PTR f;
386 struct face *face; 393 struct face *face;
387{ 394{
388 struct xftface_info *xftface_info = (struct xftface_info *) face->extra; 395 struct xftface_info *xftface_info;
396
397 if (face != face->ascii_face
398 || ! face->extra)
399 return;
389 400
390 if (xftface_info) 401 xftface_info = (struct xftface_info *) face->extra;
391 { 402 BLOCK_INPUT;
392 BLOCK_INPUT; 403 XftDrawDestroy (xftface_info->xft_draw);
393 XftDrawDestroy (xftface_info->xft_draw); 404 UNBLOCK_INPUT;
394 UNBLOCK_INPUT; 405 free (xftface_info);
395 free (xftface_info); 406 face->extra = NULL;
396 face->extra = NULL;
397 }
398} 407}
399 408
400static unsigned 409static unsigned