From 03b83a5a34a4257be9029e1f5195dcddcd531caa Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 23 Aug 2021 11:48:21 +0000 Subject: [PATCH] Key bindings steal a reference to the command instead of adding their own, it was correct not to add a reference when parsing, but the bind-key then needs to add one. --- cmd-bind-key.c | 1 + cmd-parse.y | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd-bind-key.c b/cmd-bind-key.c index 4a6c8541..bb905bce 100644 --- a/cmd-bind-key.c +++ b/cmd-bind-key.c @@ -75,6 +75,7 @@ cmd_bind_key_exec(struct cmd *self, struct cmdq_item *item) value = args_value(args, 1); if (count == 2 && value->type == ARGS_COMMANDS) { key_bindings_add(tablename, key, note, repeat, value->cmdlist); + value->cmdlist->references++; return (CMD_RETURN_NORMAL); } diff --git a/cmd-parse.y b/cmd-parse.y index f79c7fd3..a08c5819 100644 --- a/cmd-parse.y +++ b/cmd-parse.y @@ -817,7 +817,6 @@ cmd_parse_build_command(struct cmd_parse_command *cmd, goto out; values[count].type = ARGS_COMMANDS; values[count].cmdlist = pr->cmdlist; - values[count].cmdlist->references++; break; } count++;