diff options
author | nicm <nicm> | 2016-10-14 18:41:53 +0000 |
---|---|---|
committer | nicm <nicm> | 2016-10-14 18:41:53 +0000 |
commit | 1721d1994eb03beb8217fa3e61ed0cc097dd899e (patch) | |
tree | 43e7b2ac7cfbfee0b83cb80f59133d9ee9e65f0f /cfg.c | |
parent | 0ec18e537d7f67732a789c0984bc1cb89dbb0adf (diff) |
source-file and some other commands can recurse back into cmdq_continue,
which could potentially free the currently running command, so we need
to take a reference to it in cmdq_continue_one.
Fixes problem reported by Theo Buehler.
Diffstat (limited to 'cfg.c')
-rw-r--r-- | cfg.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -129,7 +129,10 @@ load_cfg(const char *path, struct cmd_q *cmdq, int quiet) static void cfg_default_done(__unused struct cmd_q *cmdq) { - if (--cfg_references != 0) + log_debug("%s: %u references%s", __func__, cfg_references, + cfg_finished ? " (finished)" : ""); + + if (cfg_finished || --cfg_references != 0) return; cfg_finished = 1; |