mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-26 04:17:33 +00:00
fix segfaults in CRIT_ERR condition
- pthread_join() on uninitialised threads causes segfault - XFreeFont() dislikes font being zero
This commit is contained in:
parent
3ab853af65
commit
bdda06f4ea
@ -328,7 +328,7 @@ static void __free_update_callbacks(struct update_cb *uc)
|
||||
uc->running = 0;
|
||||
sem_post(&uc->start_wait);
|
||||
}
|
||||
if (pthread_join(uc->thread, NULL)) {
|
||||
if (uc->thread && pthread_join(uc->thread, NULL)) {
|
||||
NORM_ERR("Error destroying thread");
|
||||
}
|
||||
|
||||
|
@ -142,8 +142,10 @@ void free_fonts(void)
|
||||
} else
|
||||
#endif /* BUILD_XFT */
|
||||
{
|
||||
XFreeFont(display, fonts[i].font);
|
||||
fonts[i].font = 0;
|
||||
if (fonts[i].font) {
|
||||
XFreeFont(display, fonts[i].font);
|
||||
fonts[i].font = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (fonts) {
|
||||
|
Loading…
Reference in New Issue
Block a user