diff options
author | donal.k.fellows@manchester.ac.uk <dkf> | 2009-09-09 22:23:57 (GMT) |
---|---|---|
committer | donal.k.fellows@manchester.ac.uk <dkf> | 2009-09-09 22:23:57 (GMT) |
commit | 3c97bee1b85a80feef1a01c7ef42abcd833392b8 (patch) | |
tree | 8eaf41ae141685c48f89c4741ca2877212ff1e19 /generic | |
parent | d328e9bc52096134bc4f315332c189c90802293b (diff) | |
download | tk-3c97bee1b85a80feef1a01c7ef42abcd833392b8.zip tk-3c97bee1b85a80feef1a01c7ef42abcd833392b8.tar.gz tk-3c97bee1b85a80feef1a01c7ef42abcd833392b8.tar.bz2 |
Try to make Tk more resilient in the face of Xft allocation failures.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkFont.c | 10 |
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; + } } } |