Fix crash in imv_loader_free

This commit is contained in:
Harry Jeffery 2017-04-18 17:36:43 +01:00
parent 8d5166d69f
commit c67d1b529c

View file

@ -57,7 +57,9 @@ struct imv_loader *imv_loader_create(void)
void imv_loader_free(struct imv_loader *ldr)
{
/* wait for any existing bg thread to finish */
pthread_join(ldr->bg_thread, NULL);
if(ldr->bg_thread) {
pthread_join(ldr->bg_thread, NULL);
}
pthread_mutex_destroy(&ldr->lock);
if(ldr->bmp) {