mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-02-05 13:38:33 +00:00
Fix: free_fonts tries sometimes tries to free much
When build with support for x11 and ran with a empty config this resulted in a segfault.
This commit is contained in:
parent
f6472cbbb5
commit
ef13d53938
@ -31,6 +31,7 @@
|
|||||||
int selected_font = 0;
|
int selected_font = 0;
|
||||||
int font_count = -1;
|
int font_count = -1;
|
||||||
struct font_list *fonts = NULL;
|
struct font_list *fonts = NULL;
|
||||||
|
char fontloaded = 0;
|
||||||
|
|
||||||
void set_font(void)
|
void set_font(void)
|
||||||
{
|
{
|
||||||
@ -120,7 +121,7 @@ void free_fonts(void)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if ((output_methods & TO_X) == 0) {
|
if ((output_methods & TO_X) == 0 || fontloaded == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (i = 0; i <= font_count; i++) {
|
for (i = 0; i <= font_count; i++) {
|
||||||
@ -189,4 +190,5 @@ void load_fonts(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
fontloaded = 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user