components/vim/vim72-patches/7.2.446
changeset 198 172fc01ce997
equal deleted inserted replaced
197:fd801ec0737c 198:172fc01ce997
       
     1 To: [email protected]
       
     2 Subject: Patch 7.2.446
       
     3 Fcc: outbox
       
     4 From: Bram Moolenaar <[email protected]>
       
     5 Mime-Version: 1.0
       
     6 Content-Type: text/plain; charset=UTF-8
       
     7 Content-Transfer-Encoding: 8bit
       
     8 ------------
       
     9 
       
    10 Patch 7.2.446
       
    11 Problem:    Crash in GUI when closing the last window in a tabpage. (ryo7000)
       
    12 Solution:   Remove the tabpage from the list before freeing the window.
       
    13 Files:	    src/window.c
       
    14 
       
    15 
       
    16 *** ../vim-7.2.445/src/window.c	2010-03-17 16:54:51.000000000 +0100
       
    17 --- src/window.c	2010-07-11 13:18:31.000000000 +0200
       
    18 ***************
       
    19 *** 2304,2309 ****
       
    20 --- 2304,2310 ----
       
    21       win_T	*wp;
       
    22       int		dir;
       
    23       tabpage_T   *ptp = NULL;
       
    24 +     int		free_tp = FALSE;
       
    25   
       
    26       /* Close the link to the buffer. */
       
    27       close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0);
       
    28 ***************
       
    29 *** 2321,2331 ****
       
    30       if (wp == NULL)
       
    31   	return;
       
    32   
       
    33 -     /* Free the memory used for the window. */
       
    34 -     wp = win_free_mem(win, &dir, tp);
       
    35 - 
       
    36       /* When closing the last window in a tab page remove the tab page. */
       
    37 !     if (wp == NULL)
       
    38       {
       
    39   	if (tp == first_tabpage)
       
    40   	    first_tabpage = tp->tp_next;
       
    41 --- 2322,2329 ----
       
    42       if (wp == NULL)
       
    43   	return;
       
    44   
       
    45       /* When closing the last window in a tab page remove the tab page. */
       
    46 !     if (tp == NULL ? firstwin == lastwin : tp->tp_firstwin == tp->tp_lastwin)
       
    47       {
       
    48   	if (tp == first_tabpage)
       
    49   	    first_tabpage = tp->tp_next;
       
    50 ***************
       
    51 *** 2341,2348 ****
       
    52   	    }
       
    53   	    ptp->tp_next = tp->tp_next;
       
    54   	}
       
    55 ! 	free_tabpage(tp);
       
    56       }
       
    57   }
       
    58   
       
    59   /*
       
    60 --- 2339,2352 ----
       
    61   	    }
       
    62   	    ptp->tp_next = tp->tp_next;
       
    63   	}
       
    64 ! 	free_tp = TRUE;
       
    65       }
       
    66 + 
       
    67 +     /* Free the memory used for the window. */
       
    68 +     win_free_mem(win, &dir, tp);
       
    69 + 
       
    70 +     if (free_tp)
       
    71 + 	free_tabpage(tp);
       
    72   }
       
    73   
       
    74   /*
       
    75 *** ../vim-7.2.445/src/version.c	2010-07-07 18:20:21.000000000 +0200
       
    76 --- src/version.c	2010-07-12 21:36:05.000000000 +0200
       
    77 ***************
       
    78 *** 683,684 ****
       
    79 --- 683,686 ----
       
    80   {   /* Add new patch number below this line */
       
    81 + /**/
       
    82 +     446,
       
    83   /**/
       
    84 
       
    85 -- 
       
    86 Not too long ago, compress was something you did to garbage...
       
    87 
       
    88  /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
       
    89 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
       
    90 \\\        download, build and distribute -- http://www.A-A-P.org        ///
       
    91  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///