From eda4ab0e8e2f97225e4c0470318e9427e09bbfb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Thu, 29 Dec 2016 17:58:00 +0100 Subject: vis: cleanup key action lifetime management --- vis.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'vis.c') diff --git a/vis.c b/vis.c index 4943280..444d56e 100644 --- a/vis.c +++ b/vis.c @@ -511,6 +511,7 @@ Vis *vis_new(Ui *ui, VisEvent *event) { array_init(&vis->motions); array_init(&vis->textobjects); array_init(&vis->bindings); + array_init(&vis->actions_user); action_reset(&vis->action); buffer_init(&vis->input_queue); vis->keys = &vis->input_queue; @@ -574,6 +575,9 @@ void vis_free(Vis *vis) { while (array_length(&vis->bindings)) vis_binding_free(vis, array_get_ptr(&vis->bindings, 0)); array_release(&vis->bindings); + while (array_length(&vis->actions_user)) + vis_action_free(vis, array_get_ptr(&vis->actions_user, 0)); + array_release(&vis->actions_user); free(vis->shell); free(vis); } -- cgit v1.2.3