diff options
author | André Twupack <atwupack@mailbox.org> | 2014-09-21 00:29:45 +0200 |
---|---|---|
committer | André Twupack <atwupack@mailbox.org> | 2014-09-21 10:42:27 +0200 |
commit | 2b937fe00d8b0b308cce87aee9f70699f8474c1e (patch) | |
tree | 7b3c7cf3597222905f907fe99233120df79ef504 /src/nvim/fileio.c | |
parent | 0ed9f3ec8338783466b0a6ab2661d9a061a436fa (diff) | |
download | rneovim-2b937fe00d8b0b308cce87aee9f70699f8474c1e.tar.gz rneovim-2b937fe00d8b0b308cce87aee9f70699f8474c1e.tar.bz2 rneovim-2b937fe00d8b0b308cce87aee9f70699f8474c1e.zip |
vim-patch:7.4.320
Problem: Possible crash when an BufLeave autocommand deletes the buffer.
Solution: Check for the window pointer being valid. Postpone freeing the
window until autocommands are done. (Yasuhiro Matsumoto)
https://code.google.com/p/vim/source/detail?r=v7-4-320
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r-- | src/nvim/fileio.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 97daa035f8..72dd7170ce 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -6754,7 +6754,8 @@ apply_autocmds_group ( --nesting; /* see matching increment above */ // When stopping to execute autocommands, restore the search patterns and - // the redo buffer. Free buffers in the au_pending_free_buf list. + // the redo buffer. Free any buffers in the au_pending_free_buf list and + // free any windows in the au_pending_free_win list. if (!autocmd_busy) { restore_search_patterns(); restoreRedobuff(); @@ -6764,6 +6765,11 @@ apply_autocmds_group ( free(au_pending_free_buf); au_pending_free_buf = b; } + while (au_pending_free_win != NULL) { + win_T *w = au_pending_free_win->w_next; + free(au_pending_free_win); + au_pending_free_win = w; + } } /* |