diff src/buffer.c @ 11690:ce434212d682 v8.0.0728

patch 8.0.0728: the terminal structure is never freed commit https://github.com/vim/vim/commit/96ca27a0ee8ae738cab9fb386984c75c6821e31a Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jul 17 23:20:24 2017 +0200 patch 8.0.0728: the terminal structure is never freed Problem: The terminal structure is never freed. Solution: Free the structure and unreference what it contains.
author Christian Brabandt <cb@256bit.org>
date Mon, 17 Jul 2017 23:30:03 +0200
parents e349dc7889f5
children 74abb6c84984
line wrap: on
line diff
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -859,6 +859,9 @@ free_buffer(buf_T *buf)
 #ifdef FEAT_JOB_CHANNEL
     channel_buffer_free(buf);
 #endif
+#ifdef FEAT_TERMINAL
+    free_terminal(buf->b_term);
+#endif
 
     buf_hashtab_remove(buf);
 
@@ -1771,7 +1774,7 @@ enter_buffer(buf_T *buf)
 #endif
 
 #ifdef FEAT_SYN_HL
-    curwin->w_s = &(buf->b_s);
+    curwin->w_s = &(curbuf->b_s);
 #endif
 
     /* Cursor on first line by default. */