Mercurial > vim
comparison src/window.c @ 4021:915fb3d2dd8f v7.3.765
updated for version 7.3.765
Problem: Segfault when doing "cclose" on BufUnload in a python function.
(Sean Reifschneider)
Solution: Skip window with NULL buffer. (Christian Brabandt)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Thu, 17 Jan 2013 14:00:11 +0100 |
parents | 79ac6744237c |
children | 48b54c590dc8 |
comparison
equal
deleted
inserted
replaced
4020:e8efce959c5b | 4021:915fb3d2dd8f |
---|---|
2274 if (win_valid(win)) | 2274 if (win_valid(win)) |
2275 win->w_closing = FALSE; | 2275 win->w_closing = FALSE; |
2276 #endif | 2276 #endif |
2277 } | 2277 } |
2278 | 2278 |
2279 if (only_one_window() && win_valid(win) && win->w_buffer == NULL | |
2280 && (last_window() || curtab != prev_curtab | |
2281 || close_last_window_tabpage(win, free_buf, prev_curtab))) | |
2282 /* Autocommands have close all windows, quit now. */ | |
2283 getout(0); | |
2284 | |
2279 /* Autocommands may have closed the window already, or closed the only | 2285 /* Autocommands may have closed the window already, or closed the only |
2280 * other window or moved to another tab page. */ | 2286 * other window or moved to another tab page. */ |
2281 if (!win_valid(win) || last_window() || curtab != prev_curtab | 2287 else if (!win_valid(win) || last_window() || curtab != prev_curtab |
2282 || close_last_window_tabpage(win, free_buf, prev_curtab)) | 2288 || close_last_window_tabpage(win, free_buf, prev_curtab)) |
2283 return; | 2289 return; |
2284 | 2290 |
2285 /* Free the memory used for the window and get the window that received | 2291 /* Free the memory used for the window and get the window that received |
2286 * the screen space. */ | 2292 * the screen space. */ |
6280 /* If there is another tab page there always is another window. */ | 6286 /* If there is another tab page there always is another window. */ |
6281 if (first_tabpage->tp_next != NULL) | 6287 if (first_tabpage->tp_next != NULL) |
6282 return FALSE; | 6288 return FALSE; |
6283 | 6289 |
6284 for (wp = firstwin; wp != NULL; wp = wp->w_next) | 6290 for (wp = firstwin; wp != NULL; wp = wp->w_next) |
6285 if ((!((wp->w_buffer->b_help && !curbuf->b_help) | 6291 if (wp->w_buffer != NULL |
6292 && (!((wp->w_buffer->b_help && !curbuf->b_help) | |
6286 # ifdef FEAT_QUICKFIX | 6293 # ifdef FEAT_QUICKFIX |
6287 || wp->w_p_pvw | 6294 || wp->w_p_pvw |
6288 # endif | 6295 # endif |
6289 ) || wp == curwin) | 6296 ) || wp == curwin) |
6290 # ifdef FEAT_AUTOCMD | 6297 # ifdef FEAT_AUTOCMD |