diff --git a/src/control/jobs/control_jobs.c b/src/control/jobs/control_jobs.c index d54f940f0aef..5c13e1004a20 100644 --- a/src/control/jobs/control_jobs.c +++ b/src/control/jobs/control_jobs.c @@ -206,7 +206,7 @@ static int32_t _generic_dt_control_fileop_images_job_run(dt_job_t *job, gboolean completeSuccess = TRUE; double prev_time = 0; - while(t && !_job_cancelled(job)) + while(dt_control_running() && t && !_job_cancelled(job)) { completeSuccess &= (fileop_callback(GPOINTER_TO_INT(t->data), film_id) != -1); t = g_list_next(t); @@ -621,7 +621,7 @@ static int32_t _control_merge_hdr_job_run(dt_job_t *job) (dt_control_merge_hdr_format_t){.parent = { 0 }, .d = &d }; int num = 1; - while(t) + while(t && dt_control_running()) { if(d.abort) goto end; @@ -640,7 +640,7 @@ static int32_t _control_merge_hdr_job_run(dt_job_t *job) num++; } - if(d.abort) goto end; + if(d.abort || !dt_control_running()) goto end; // normalize by white level to make clipping at 1.0 work as expected @@ -941,7 +941,7 @@ static int32_t _control_remove_images_job_run(dt_job_t *job) double fraction = 0.0; double prev_time = 0; - for(; t && !_job_cancelled(job); t = g_list_next(t)) + for(; dt_control_running() && t && !_job_cancelled(job); t = g_list_next(t)) { const dt_imgid_t imgid = GPOINTER_TO_INT(t->data); const int32_t exist_count = _count_images_using_overlay(imgid); @@ -1525,7 +1525,7 @@ static int32_t _control_refresh_exif_run(dt_job_t *job) dt_control_job_set_progress_message(job, message); double prev_time = 0; - while(t) + while(t && dt_control_running()) { const dt_imgid_t imgid = GPOINTER_TO_INT(t->data); if(dt_is_valid_imgid(imgid)) @@ -1869,7 +1869,7 @@ static int32_t _control_export_job_run(dt_job_t *job) double prev_time = 0; - while(t && !_job_cancelled(job)) + while(dt_control_running() && t && !_job_cancelled(job)) { const dt_imgid_t imgid = GPOINTER_TO_INT(t->data); t = g_list_next(t); @@ -2885,7 +2885,7 @@ static int32_t _control_import_job_run(dt_job_t *job) double update_interval = INIT_UPDATE_INTERVAL; char *prev_filename = NULL; char *prev_output = NULL; - for(GList *img = t; img && !_job_cancelled(job); img = g_list_next(img)) + for(GList *img = t; dt_control_running() && img && !_job_cancelled(job); img = g_list_next(img)) { if(data->session) {