aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2017-04-18 17:36:43 +0100
committerHarry Jeffery <harry@exec64.co.uk>2017-04-18 17:36:43 +0100
commitc67d1b529cd7c1b1e95c30b2a34e6b53aa2e2bdb (patch)
treefa11a2c60f2add75dd5d016b7528824bbc47ba70
parent8d5166d69ff1abf893409d847adc80a84dc688e8 (diff)
downloadimv-c67d1b529cd7c1b1e95c30b2a34e6b53aa2e2bdb.tar.gz
Fix crash in imv_loader_free
-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) {