aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/loader.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/loader.c b/src/loader.c
index c5b64a6..e85050b 100644
--- a/src/loader.c
+++ b/src/loader.c
@@ -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) {