From 67271d056409ce3727c282968a7186088bf19a28 Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Sun, 9 Jun 2024 21:43:39 +0200 Subject: Fix crash in completion The crash happened when a new file was opened followed by another completion. The reason was that not accepting any of the completion suggestions caused the completion to stay active, causing the context to not be updated for the next completion. --- src/main/completion.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/main/completion.c b/src/main/completion.c index b2170e7..52bf6f8 100644 --- a/src/main/completion.c +++ b/src/main/completion.c @@ -379,6 +379,11 @@ bool completion_active() { static void cleanup_active_comp_ctx(void *userdata) { struct active_completion_ctx *ctx = (struct active_completion_ctx *)userdata; + + if (g_state.ctx == ctx && g_state.active) { + abort_completion(); + } + free(ctx->providers); free(ctx); } -- cgit v1.2.3