1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-27 04:32:55 +00:00

Fix segfault on reload.

This commit is contained in:
Brenden Matthews 2009-05-24 17:49:50 -06:00
parent d0de7cbd63
commit c92272a943
2 changed files with 13 additions and 6 deletions

View File

@ -6893,6 +6893,10 @@ static void reload_config(void)
llua_close();
#endif /* HAVE_LUA */
#ifdef X11
X11_destroy_window();
#endif /* X11 */
if (current_config) {
clear_fs_stats();
load_config_file(current_config);
@ -6905,7 +6909,6 @@ static void reload_config(void)
}
#ifdef X11
X11_destroy_window();
x_initialised = NO;
#endif /* X11 */
extract_variable_text(global_text);
@ -7247,6 +7250,7 @@ static void X11_create_window(void)
#endif /* OWN_WINDOW */
selected_font = 0;
load_fonts();
update_text_area(); /* to position text/window on screen */
#ifdef OWN_WINDOW

View File

@ -34,8 +34,9 @@ struct font_list *fonts = NULL;
void set_font(void)
{
if ((output_methods & TO_X) == 0)
if ((output_methods & TO_X) == 0) {
return;
}
#ifdef XFT
if (use_xft) {
if (window.xftdraw != NULL) {
@ -52,8 +53,9 @@ void set_font(void)
int addfont(const char *data_in)
{
if ((output_methods & TO_X) == 0)
if ((output_methods & TO_X) == 0) {
return 0;
}
if (font_count > MAX_FONTS) {
CRIT_ERR("you don't need that many fonts, sorry.");
}
@ -87,8 +89,9 @@ int addfont(const char *data_in)
void set_first_font(const char *data_in)
{
if ((output_methods & TO_X) == 0)
if ((output_methods & TO_X) == 0) {
return;
}
if (font_count < 0) {
if ((fonts = (struct font_list *) malloc(sizeof(struct font_list)))
== NULL) {
@ -109,8 +112,9 @@ void free_fonts(void)
{
int i;
if ((output_methods & TO_X) == 0)
if ((output_methods & TO_X) == 0) {
return;
}
for (i = 0; i <= font_count; i++) {
#ifdef XFT
if (use_xft) {
@ -175,7 +179,6 @@ void load_fonts(void)
ERR("can't load font '%s'", fonts[i].name);
if ((fonts[i].font = XLoadQueryFont(display, "fixed")) == NULL) {
CRIT_ERR("can't load font '%s'", "fixed");
printf("loaded fixed?\n");
}
}
}