lkundrak / rpms / vim

Forked from rpms/vim 4 years ago
Clone
8a036e3
To: vim-dev@vim.org
8a036e3
Subject: Patch 7.2.446
8a036e3
Fcc: outbox
8a036e3
From: Bram Moolenaar <Bram@moolenaar.net>
8a036e3
Mime-Version: 1.0
8a036e3
Content-Type: text/plain; charset=UTF-8
8a036e3
Content-Transfer-Encoding: 8bit
8a036e3
------------
8a036e3
8a036e3
Patch 7.2.446
8a036e3
Problem:    Crash in GUI when closing the last window in a tabpage. (ryo7000)
8a036e3
Solution:   Remove the tabpage from the list before freeing the window.
8a036e3
Files:	    src/window.c
8a036e3
8a036e3
8a036e3
*** ../vim-7.2.445/src/window.c	2010-03-17 16:54:51.000000000 +0100
8a036e3
--- src/window.c	2010-07-11 13:18:31.000000000 +0200
8a036e3
***************
8a036e3
*** 2304,2309 ****
8a036e3
--- 2304,2310 ----
8a036e3
      win_T	*wp;
8a036e3
      int		dir;
8a036e3
      tabpage_T   *ptp = NULL;
8a036e3
+     int		free_tp = FALSE;
8a036e3
  
8a036e3
      /* Close the link to the buffer. */
8a036e3
      close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0);
8a036e3
***************
8a036e3
*** 2321,2331 ****
8a036e3
      if (wp == NULL)
8a036e3
  	return;
8a036e3
  
8a036e3
-     /* Free the memory used for the window. */
8a036e3
-     wp = win_free_mem(win, &dir, tp);
8a036e3
- 
8a036e3
      /* When closing the last window in a tab page remove the tab page. */
8a036e3
!     if (wp == NULL)
8a036e3
      {
8a036e3
  	if (tp == first_tabpage)
8a036e3
  	    first_tabpage = tp->tp_next;
8a036e3
--- 2322,2329 ----
8a036e3
      if (wp == NULL)
8a036e3
  	return;
8a036e3
  
8a036e3
      /* When closing the last window in a tab page remove the tab page. */
8a036e3
!     if (tp == NULL ? firstwin == lastwin : tp->tp_firstwin == tp->tp_lastwin)
8a036e3
      {
8a036e3
  	if (tp == first_tabpage)
8a036e3
  	    first_tabpage = tp->tp_next;
8a036e3
***************
8a036e3
*** 2341,2348 ****
8a036e3
  	    }
8a036e3
  	    ptp->tp_next = tp->tp_next;
8a036e3
  	}
8a036e3
! 	free_tabpage(tp);
8a036e3
      }
8a036e3
  }
8a036e3
  
8a036e3
  /*
8a036e3
--- 2339,2352 ----
8a036e3
  	    }
8a036e3
  	    ptp->tp_next = tp->tp_next;
8a036e3
  	}
8a036e3
! 	free_tp = TRUE;
8a036e3
      }
8a036e3
+ 
8a036e3
+     /* Free the memory used for the window. */
8a036e3
+     win_free_mem(win, &dir, tp);
8a036e3
+ 
8a036e3
+     if (free_tp)
8a036e3
+ 	free_tabpage(tp);
8a036e3
  }
8a036e3
  
8a036e3
  /*
8a036e3
*** ../vim-7.2.445/src/version.c	2010-07-07 18:20:21.000000000 +0200
8a036e3
--- src/version.c	2010-07-12 21:36:05.000000000 +0200
8a036e3
***************
8a036e3
*** 683,684 ****
8a036e3
--- 683,686 ----
8a036e3
  {   /* Add new patch number below this line */
8a036e3
+ /**/
8a036e3
+     446,
8a036e3
  /**/
8a036e3
8a036e3
-- 
8a036e3
Not too long ago, compress was something you did to garbage...
8a036e3
8a036e3
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
8a036e3
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
8a036e3
\\\        download, build and distribute -- http://www.A-A-P.org        ///
8a036e3
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///