From f52050784e7e1426eafb5e69bc2fa37219415406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 27 Dec 2016 23:22:01 +0100 Subject: vis: properly free dynamic key bindings The handling of :unmap needs to be revisited at some point. --- vis.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'vis.c') diff --git a/vis.c b/vis.c index 43f9371..4943280 100644 --- a/vis.c +++ b/vis.c @@ -510,6 +510,7 @@ Vis *vis_new(Ui *ui, VisEvent *event) { vis->registers[VIS_REG_CLIPBOARD].type = REGISTER_CLIPBOARD; array_init(&vis->motions); array_init(&vis->textobjects); + array_init(&vis->bindings); action_reset(&vis->action); buffer_init(&vis->input_queue); vis->keys = &vis->input_queue; @@ -570,6 +571,9 @@ void vis_free(Vis *vis) { map_free(vis_modes[i].bindings); array_release_full(&vis->motions); array_release_full(&vis->textobjects); + while (array_length(&vis->bindings)) + vis_binding_free(vis, array_get_ptr(&vis->bindings, 0)); + array_release(&vis->bindings); free(vis->shell); free(vis); } -- cgit v1.2.3