summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-04-12 18:05:18 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-04-12 18:05:18 (GMT)
commitb9a4361754a553ade5449d8410f5ac5b021f7e00 (patch)
tree018237a9d1d336f291a224d31683cd43a4b6ac47 /unix
parent81575a89268f055404ce2b8655a24ec1ccbd188d (diff)
downloadtk-b9a4361754a553ade5449d8410f5ac5b021f7e00.zip
tk-b9a4361754a553ade5449d8410f5ac5b021f7e00.tar.gz
tk-b9a4361754a553ade5449d8410f5ac5b021f7e00.tar.bz2
Additional suggestion by chw. Unfortunately doesn't help any on Ubuntu :-(
Diffstat (limited to 'unix')
-rw-r--r--unix/tkUnixRFont.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c
index a9c75ed..cf8c68f 100644
--- a/unix/tkUnixRFont.c
+++ b/unix/tkUnixRFont.c
@@ -334,11 +334,17 @@ InitFont(
* Fill in platform-specific fields of TkFont.
*/
- ftFont = GetFont(fontPtr, 0, 0.0);
- fontPtr->font.fid = XLoadFont(Tk_Display(tkwin), "fixed");
+ errorFlag = 0;
handler = Tk_CreateErrorHandler(Tk_Display(tkwin),
-1, -1, -1, InitFontErrorProc, (ClientData) &errorFlag);
- errorFlag = 0;
+ ftFont = GetFont(fontPtr, 0, 0.0);
+ if ((ftFont == NULL) || errorFlag) {
+ Tk_DeleteErrorHandler(handler);
+ FinishedWithFont(fontPtr);
+ ckfree(fontPtr);
+ return NULL;
+ }
+ fontPtr->font.fid = XLoadFont(Tk_Display(tkwin), "fixed");
GetTkFontAttributes(ftFont, &fontPtr->font.fa);
GetTkFontMetrics(ftFont, &fontPtr->font.fm);
Tk_DeleteErrorHandler(handler);