diff options
| author | Albert Cervin <albert@acervin.com> | 2024-06-09 21:43:39 +0200 |
|---|---|---|
| committer | Albert Cervin <albert@acervin.com> | 2024-06-09 21:45:36 +0200 |
| commit | 67271d056409ce3727c282968a7186088bf19a28 (patch) | |
| tree | a5fb74039cb5f2f35f987266ac233de4d0cea24a /src | |
| parent | b9fa579d78f4f2de8ea3d646488c6febffe2c127 (diff) | |
| download | dged-67271d056409ce3727c282968a7186088bf19a28.tar.gz dged-67271d056409ce3727c282968a7186088bf19a28.tar.xz dged-67271d056409ce3727c282968a7186088bf19a28.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/completion.c | 5 |
1 files changed, 5 insertions, 0 deletions
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); } |
