0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

updated for version 7.3.390

Problem:    Using NULL buffer pointer in a window.
Solution:   Check for w_buffer being NULL in more places. (Bjorn Winckler)
This commit is contained in:
Bram Moolenaar
2011-12-30 15:01:59 +01:00
parent 5d6f75e17e
commit fc57380c3f
4 changed files with 18 additions and 7 deletions

View File

@@ -2170,7 +2170,7 @@ win_close(win, free_buf)
/* When closing the help window, try restoring a snapshot after closing
* the window. Otherwise clear the snapshot, it's now invalid. */
if (win->w_buffer->b_help)
if (win->w_buffer != NULL && win->w_buffer->b_help)
help_window = TRUE;
else
clear_snapshot(curtab, SNAP_HELP_IDX);
@@ -2214,13 +2214,15 @@ win_close(win, free_buf)
#ifdef FEAT_SYN_HL
/* Free independent synblock before the buffer is freed. */
reset_synblock(win);
if (win->w_buffer != NULL)
reset_synblock(win);
#endif
/*
* Close the link to the buffer.
*/
close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0);
if (win->w_buffer != NULL)
close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0);
/* Autocommands may have closed the window already, or closed the only
* other window or moved to another tab page. */