From d2d43987d0f35af2bc012f1260fdb81c851fe390 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 18 Mar 2019 09:46:42 +0000 Subject: With force, kill previous job before starting new. Fixes problem reported by Scott Mcdermott in GitHub issue 1627. --- format.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'format.c') diff --git a/format.c b/format.c index bcc31d3c..aa0a8aa2 100644 --- a/format.c +++ b/format.c @@ -346,7 +346,9 @@ format_job_get(struct format_tree *ft, const char *cmd) force = (ft->flags & FORMAT_FORCE); t = time(NULL); - if (fj->job == NULL && (force || fj->last != t)) { + if (force && fj->job != NULL) + job_free(fj->job); + if (force || (fj->job == NULL && fj->last != t)) { fj->job = job_run(expanded, NULL, server_client_get_cwd(ft->client, NULL), format_job_update, format_job_complete, NULL, fj, JOB_NOWAIT); -- cgit