]> granicus.if.org Git - vim/commitdiff
patch 8.1.1424: crash when popup menu is deleted while waiting for char v8.1.1424
authorBram Moolenaar <Bram@vim.org>
Thu, 30 May 2019 13:53:29 +0000 (15:53 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 30 May 2019 13:53:29 +0000 (15:53 +0200)
Problem:    Crash when popup menu is deleted while waiting for char.
Solution:   Bail out when pum_array was cleared.

src/popupmnu.c
src/version.c

index 9ebf6b7a6fbdadb87a4cbb006c366e4fc0582297..276d49fd013898ecbcac9e966e7f1854659f62c9 100644 (file)
@@ -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)
        {
index 2d70ed51d05a11047b44f75ba6d2ea326438be99..89068d87a5f8140ae49a07110595dbe88ff5a8e2 100644 (file)
@@ -767,6 +767,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1424,
 /**/
     1423,
 /**/