From 5c3fb04623d0260762f1c3c1ba250a407098ff2a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 30 May 2019 15:53:29 +0200 Subject: [PATCH] patch 8.1.1424: crash when popup menu is deleted while waiting for char Problem: Crash when popup menu is deleted while waiting for char. Solution: Bail out when pum_array was cleared. --- src/popupmnu.c | 5 ++++- src/version.c | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/popupmnu.c b/src/popupmnu.c index 9ebf6b7a6..276d49fd0 100644 --- a/src/popupmnu.c +++ b/src/popupmnu.c @@ -1302,7 +1302,10 @@ pum_show_popupmenu(vimmenu_T *menu) out_flush(); c = vgetc(); - if (c == ESC || c == Ctrl_C) + + // Bail out when typing Esc, CTRL-C or some callback closed the popup + // menu. + if (c == ESC || c == Ctrl_C || pum_array == NULL) break; else if (c == CAR || c == NL) { diff --git a/src/version.c b/src/version.c index 2d70ed51d..89068d87a 100644 --- a/src/version.c +++ b/src/version.c @@ -767,6 +767,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1424, /**/ 1423, /**/