mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-27 20:44:56 +00:00
Fix segfault on reload.
This commit is contained in:
parent
d0de7cbd63
commit
c92272a943
@ -6893,6 +6893,10 @@ static void reload_config(void)
|
|||||||
llua_close();
|
llua_close();
|
||||||
#endif /* HAVE_LUA */
|
#endif /* HAVE_LUA */
|
||||||
|
|
||||||
|
#ifdef X11
|
||||||
|
X11_destroy_window();
|
||||||
|
#endif /* X11 */
|
||||||
|
|
||||||
if (current_config) {
|
if (current_config) {
|
||||||
clear_fs_stats();
|
clear_fs_stats();
|
||||||
load_config_file(current_config);
|
load_config_file(current_config);
|
||||||
@ -6905,7 +6909,6 @@ static void reload_config(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef X11
|
#ifdef X11
|
||||||
X11_destroy_window();
|
|
||||||
x_initialised = NO;
|
x_initialised = NO;
|
||||||
#endif /* X11 */
|
#endif /* X11 */
|
||||||
extract_variable_text(global_text);
|
extract_variable_text(global_text);
|
||||||
@ -7247,6 +7250,7 @@ static void X11_create_window(void)
|
|||||||
#endif /* OWN_WINDOW */
|
#endif /* OWN_WINDOW */
|
||||||
|
|
||||||
selected_font = 0;
|
selected_font = 0;
|
||||||
|
load_fonts();
|
||||||
update_text_area(); /* to position text/window on screen */
|
update_text_area(); /* to position text/window on screen */
|
||||||
|
|
||||||
#ifdef OWN_WINDOW
|
#ifdef OWN_WINDOW
|
||||||
|
13
src/fonts.c
13
src/fonts.c
@ -34,8 +34,9 @@ struct font_list *fonts = NULL;
|
|||||||
|
|
||||||
void set_font(void)
|
void set_font(void)
|
||||||
{
|
{
|
||||||
if ((output_methods & TO_X) == 0)
|
if ((output_methods & TO_X) == 0) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
#ifdef XFT
|
#ifdef XFT
|
||||||
if (use_xft) {
|
if (use_xft) {
|
||||||
if (window.xftdraw != NULL) {
|
if (window.xftdraw != NULL) {
|
||||||
@ -52,8 +53,9 @@ void set_font(void)
|
|||||||
|
|
||||||
int addfont(const char *data_in)
|
int addfont(const char *data_in)
|
||||||
{
|
{
|
||||||
if ((output_methods & TO_X) == 0)
|
if ((output_methods & TO_X) == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
if (font_count > MAX_FONTS) {
|
if (font_count > MAX_FONTS) {
|
||||||
CRIT_ERR("you don't need that many fonts, sorry.");
|
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)
|
void set_first_font(const char *data_in)
|
||||||
{
|
{
|
||||||
if ((output_methods & TO_X) == 0)
|
if ((output_methods & TO_X) == 0) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
if (font_count < 0) {
|
if (font_count < 0) {
|
||||||
if ((fonts = (struct font_list *) malloc(sizeof(struct font_list)))
|
if ((fonts = (struct font_list *) malloc(sizeof(struct font_list)))
|
||||||
== NULL) {
|
== NULL) {
|
||||||
@ -109,8 +112,9 @@ void free_fonts(void)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if ((output_methods & TO_X) == 0)
|
if ((output_methods & TO_X) == 0) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
for (i = 0; i <= font_count; i++) {
|
for (i = 0; i <= font_count; i++) {
|
||||||
#ifdef XFT
|
#ifdef XFT
|
||||||
if (use_xft) {
|
if (use_xft) {
|
||||||
@ -175,7 +179,6 @@ void load_fonts(void)
|
|||||||
ERR("can't load font '%s'", fonts[i].name);
|
ERR("can't load font '%s'", fonts[i].name);
|
||||||
if ((fonts[i].font = XLoadQueryFont(display, "fixed")) == NULL) {
|
if ((fonts[i].font = XLoadQueryFont(display, "fixed")) == NULL) {
|
||||||
CRIT_ERR("can't load font '%s'", "fixed");
|
CRIT_ERR("can't load font '%s'", "fixed");
|
||||||
printf("loaded fixed?\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user