summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-07-17 23:20:24 +0200
committerBram Moolenaar <Bram@vim.org>2017-07-17 23:20:24 +0200
commit96ca27a0ee8ae738cab9fb386984c75c6821e31a (patch)
treed4c986e7262a996a095f6b4b71601dfc361c57a5 /src/buffer.c
parent60d0e97497f1104b31f711072ef174af533b61fa (diff)
downloadvim-git-96ca27a0ee8ae738cab9fb386984c75c6821e31a.tar.gz
patch 8.0.0728: the terminal structure is never freedv8.0.0728
Problem: The terminal structure is never freed. Solution: Free the structure and unreference what it contains.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c
index e8e1a6de0..dbd4d3ae9 100644
--- 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. */