1
0
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:
Phil Sutter 2010-01-10 22:09:33 +01:00
parent 3ab853af65
commit bdda06f4ea
2 changed files with 5 additions and 3 deletions

View File

@ -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");
}

View File

@ -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) {