summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-30 15:53:29 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-30 15:53:29 +0200
commit5c3fb04623d0260762f1c3c1ba250a407098ff2a (patch)
tree00b78d9fe8aa3a83b23f12f8211ee48ea8ccc039
parentcacc6a5c986fbc716bf53b6916f076dd7b388142 (diff)
patch 8.1.1424: crash when popup menu is deleted while waiting for charv8.1.1424
Problem: Crash when popup menu is deleted while waiting for char. Solution: Bail out when pum_array was cleared.
-rw-r--r--src/popupmnu.c5
-rw-r--r--src/version.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/popupmnu.c b/src/popupmnu.c
index 9ebf6b7a6f..276d49fd01 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 2d70ed51d0..89068d87a5 100644
--- a/src/version.c
+++ b/src/version.c
@@ -768,6 +768,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1424,
+/**/
1423,
/**/
1422,