mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-23 14:42:29 +01:00
WINGs: Do not call exit()
WMCreateFont() was calling exit() if it could not create the font, and was trying too hard not to return NULL. Just return NULL if the font could not be created instead of exit()ing and let callers decide what to do upon failure. Thanks to Christian <chris@computersalat.de> for reporting this.
This commit is contained in:
@@ -144,17 +144,9 @@ WMFont *WMCreateFont(WMScreen * scrPtr, char *fontName)
|
|||||||
|
|
||||||
font->font = XftFontOpenName(display, scrPtr->screen, fname);
|
font->font = XftFontOpenName(display, scrPtr->screen, fname);
|
||||||
if (!font->font) {
|
if (!font->font) {
|
||||||
printf("Font named %s doesn't exist.\n", fname);
|
|
||||||
printf("Please check your system configuration.\n");
|
|
||||||
printf("Will try default font %s.\n", DEFAULT_FONT);
|
|
||||||
font->font = XftFontOpenName(display, scrPtr->screen, DEFAULT_FONT);
|
|
||||||
if (!font->font) {
|
|
||||||
printf("Unrecoverable font error! I must die!\n");
|
|
||||||
wfree(font);
|
wfree(font);
|
||||||
wfree(fname);
|
wfree(fname);
|
||||||
exit(1);
|
return NULL;
|
||||||
} else
|
|
||||||
printf("Default font loading succeded.\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
font->height = font->font->ascent + font->font->descent;
|
font->height = font->font->ascent + font->font->descent;
|
||||||
|
|||||||
Reference in New Issue
Block a user