| To: vim_dev@googlegroups.com |
| Subject: Patch 7.3.765 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| |
| Patch 7.3.765 |
| Problem: Segfault when doing "cclose" on BufUnload in a python function. |
| (Sean Reifschneider) |
| Solution: Skip window with NULL buffer. (Christian Brabandt) |
| Files: src/main.c, src/window.c |
| |
| |
| |
| |
| |
| *** 1376,1381 **** |
| --- 1376,1384 ---- |
| for (wp = (tp == curtab) |
| ? firstwin : tp->tp_firstwin; wp != NULL; wp = wp->w_next) |
| { |
| + if (wp->w_buffer == NULL) |
| + /* Autocmd must have close the buffer already, skip. */ |
| + continue; |
| buf = wp->w_buffer; |
| if (buf->b_changedtick != -1) |
| { |
| |
| |
| |
| *** 2276,2284 **** |
| #endif |
| } |
| |
| /* Autocommands may have closed the window already, or closed the only |
| * other window or moved to another tab page. */ |
| ! if (!win_valid(win) || last_window() || curtab != prev_curtab |
| || close_last_window_tabpage(win, free_buf, prev_curtab)) |
| return; |
| |
| --- 2276,2290 ---- |
| #endif |
| } |
| |
| + if (only_one_window() && win_valid(win) && win->w_buffer == NULL |
| + && (last_window() || curtab != prev_curtab |
| + || close_last_window_tabpage(win, free_buf, prev_curtab))) |
| + /* Autocommands have close all windows, quit now. */ |
| + getout(0); |
| + |
| /* Autocommands may have closed the window already, or closed the only |
| * other window or moved to another tab page. */ |
| ! else if (!win_valid(win) || last_window() || curtab != prev_curtab |
| || close_last_window_tabpage(win, free_buf, prev_curtab)) |
| return; |
| |
| |
| *** 6282,6288 **** |
| return FALSE; |
| |
| for (wp = firstwin; wp != NULL; wp = wp->w_next) |
| ! if ((!((wp->w_buffer->b_help && !curbuf->b_help) |
| # ifdef FEAT_QUICKFIX |
| || wp->w_p_pvw |
| # endif |
| --- 6288,6295 ---- |
| return FALSE; |
| |
| for (wp = firstwin; wp != NULL; wp = wp->w_next) |
| ! if (wp->w_buffer != NULL |
| ! && (!((wp->w_buffer->b_help && !curbuf->b_help) |
| # ifdef FEAT_QUICKFIX |
| || wp->w_p_pvw |
| # endif |
| |
| |
| |
| *** 727,728 **** |
| --- 727,730 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 765, |
| /**/ |
| |
| -- |
| He was not in the least bit scared to be mashed into a pulp |
| Or to have his eyes gouged out and his elbows broken; |
| To have his kneecaps split and his body burned away |
| And his limbs all hacked and mangled, brave Sir Robin. |
| "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD |
| |
| /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ |
| /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
| \\\ an exciting new programming language -- http://www.Zimbu.org /// |
| \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |