Commits

Anonymous committed 915fb3d

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)

Comments (0)

Files changed (3)

 	    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)
 		{
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    765,
+/**/
     764,
 /**/
     763,
 #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. */
-    if (!win_valid(win) || last_window() || curtab != prev_curtab
+    else if (!win_valid(win) || last_window() || curtab != prev_curtab
 	    || close_last_window_tabpage(win, free_buf, prev_curtab))
 	return;
 
 	return FALSE;
 
     for (wp = firstwin; wp != NULL; wp = wp->w_next)
-	if ((!((wp->w_buffer->b_help && !curbuf->b_help)
+	if (wp->w_buffer != NULL
+		&& (!((wp->w_buffer->b_help && !curbuf->b_help)
 # ifdef FEAT_QUICKFIX
 		    || wp->w_p_pvw
 # endif