Mercurial > vim
comparison src/fileio.c @ 5816:29eb4c2a33ac v7.4.251
updated for version 7.4.251
Problem: Crash when BufAdd autocommand wipes out the buffer.
Solution: Check for buffer to still be valid. Postpone freeing the buffer
structure. (Hirohito Higashi)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 06 Apr 2014 20:45:43 +0200 |
parents | 410ef4f1a3d2 |
children | 1ee3fc5b40ae |
comparison
equal
deleted
inserted
replaced
5815:d735e62f5925 | 5816:29eb4c2a33ac |
---|---|
9546 vim_free(sfname); | 9546 vim_free(sfname); |
9547 --nesting; /* see matching increment above */ | 9547 --nesting; /* see matching increment above */ |
9548 | 9548 |
9549 /* | 9549 /* |
9550 * When stopping to execute autocommands, restore the search patterns and | 9550 * When stopping to execute autocommands, restore the search patterns and |
9551 * the redo buffer. | 9551 * the redo buffer. Free buffers in the au_pending_free_buf list. |
9552 */ | 9552 */ |
9553 if (!autocmd_busy) | 9553 if (!autocmd_busy) |
9554 { | 9554 { |
9555 restore_search_patterns(); | 9555 restore_search_patterns(); |
9556 restoreRedobuff(); | 9556 restoreRedobuff(); |
9557 did_filetype = FALSE; | 9557 did_filetype = FALSE; |
9558 while (au_pending_free_buf != NULL) | |
9559 { | |
9560 buf_T *b = au_pending_free_buf->b_next; | |
9561 vim_free(au_pending_free_buf); | |
9562 au_pending_free_buf = b; | |
9563 } | |
9558 } | 9564 } |
9559 | 9565 |
9560 /* | 9566 /* |
9561 * Some events don't set or reset the Changed flag. | 9567 * Some events don't set or reset the Changed flag. |
9562 * Check if still in the same buffer! | 9568 * Check if still in the same buffer! |