]> granicus.if.org Git - vim/commitdiff
updated for version 7.4a.044 v7.4a.044
authorBram Moolenaar <Bram@vim.org>
Wed, 24 Jul 2013 15:51:57 +0000 (17:51 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 24 Jul 2013 15:51:57 +0000 (17:51 +0200)
Problem:    Test 96 sometimes fails.
Solution:   Clear window from b_wininfo in win_free().  (Suggestion by
            Yukihiro Nakadaira)

src/version.c
src/window.c

index 946a3cfc8201ad5d4b0e06fd5e510db03659a613..43ad9dd6f146b1a0a172cf1ca7254e05a8bd663c 100644 (file)
@@ -727,6 +727,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    44,
 /**/
     43,
 /**/
index d1c1e93d9b785f6e158821b9768fedaea8e76e11..16e0ee78b7a4db5f089c2f2850ba1d1dd0f644aa 100644 (file)
@@ -4518,7 +4518,7 @@ win_alloc(after, hidden)
 #if defined(FEAT_WINDOWS) || defined(PROTO)
 
 /*
- * remove window 'wp' from the window list and free the structure
+ * Remove window 'wp' from the window list and free the structure.
  */
     static void
 win_free(wp, tp)
@@ -4526,6 +4526,8 @@ win_free(wp, tp)
     tabpage_T  *tp;            /* tab page "win" is in, NULL for current */
 {
     int                i;
+    buf_T      *buf;
+    wininfo_T  *wip;
 
 #ifdef FEAT_FOLDING
     clearFolding(wp);
@@ -4586,6 +4588,13 @@ win_free(wp, tp)
 
     vim_free(wp->w_localdir);
 
+    /* Remove the window from the b_wininfo lists, it may happen that the
+     * freed memory is re-used for another window. */
+    for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+       for (wip = buf->b_wininfo; wip != NULL; wip = wip->wi_next)
+           if (wip->wi_win == wp)
+               wip->wi_win = NULL;
+
 #ifdef FEAT_SEARCH_EXTRA
     clear_matches(wp);
 #endif