summaryrefslogtreecommitdiffstats
path: root/generic/tkFont.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-09-09 22:23:57 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-09-09 22:23:57 (GMT)
commit4727c0c410cd50d19c06d78b4f36cfc4aa7e829d (patch)
tree8eaf41ae141685c48f89c4741ca2877212ff1e19 /generic/tkFont.c
parentb1a164c0a1f1822b82ed874aa176a5e3da80122e (diff)
downloadtk-4727c0c410cd50d19c06d78b4f36cfc4aa7e829d.zip
tk-4727c0c410cd50d19c06d78b4f36cfc4aa7e829d.tar.gz
tk-4727c0c410cd50d19c06d78b4f36cfc4aa7e829d.tar.bz2
Try to make Tk more resilient in the face of Xft allocation failures.
Diffstat (limited to 'generic/tkFont.c')
-rw-r--r--generic/tkFont.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/generic/tkFont.c b/generic/tkFont.c
index cfb6d80..27303a0 100644
--- a/generic/tkFont.c
+++ b/generic/tkFont.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkFont.c,v 1.56 2009/07/21 15:16:47 dkf Exp $
+ * RCS: @(#) $Id: tkFont.c,v 1.57 2009/09/09 22:23:58 dkf Exp $
*/
#include "tkInt.h"
@@ -1188,6 +1188,14 @@ Tk_AllocFontFromObj(
*/
fontPtr = TkpGetFontFromAttributes(NULL, tkwin, &fa);
+ if (fontPtr == NULL) {
+ Tcl_AppendResult(interp, "failed to allocate font due to ",
+ "internal font engine problem", NULL);
+ if (isNew) {
+ Tcl_DeleteHashEntry(cacheHashPtr);
+ }
+ return NULL;
+ }
}
}