0
0
mirror of https://github.com/vim/vim.git synced 2025-10-01 04:54:07 -04:00

patch 8.1.1872: when Vim exits because of a signal, VimLeave is not triggered

Problem:    When Vim exits because of a signal, VimLeave is not triggered.
            (Daniel Hahler)
Solution:   Unblock autocommands when triggering VimLeave. (closes #4818)
This commit is contained in:
Bram Moolenaar
2019-08-17 16:33:23 +02:00
parent ff9f27cdc7
commit c7226684c8
2 changed files with 16 additions and 2 deletions

View File

@@ -1485,7 +1485,19 @@ getout(int exitval)
#endif #endif
if (v_dying <= 1) if (v_dying <= 1)
{
int unblock = 0;
// deathtrap() blocks autocommands, but we do want to trigger VimLeave.
if (is_autocmd_blocked())
{
unblock_autocmds();
++unblock;
}
apply_autocmds(EVENT_VIMLEAVE, NULL, NULL, FALSE, curbuf); apply_autocmds(EVENT_VIMLEAVE, NULL, NULL, FALSE, curbuf);
if (unblock)
block_autocmds();
}
#ifdef FEAT_PROFILE #ifdef FEAT_PROFILE
profile_dump(); profile_dump();

View File

@@ -769,6 +769,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1872,
/**/ /**/
1871, 1871,
/**/ /**/