summaryrefslogtreecommitdiff
path: root/src/terminal.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-07-27 22:14:59 +0200
committerBram Moolenaar <Bram@vim.org>2017-07-27 22:14:59 +0200
commita2c45a17c174d815fd1d160f92ec6c277201e111 (patch)
treeffe580e12f4dd100b51cf5fde293b19814ab305f /src/terminal.c
parent0e83f02d80acacee55c5de3bbbee52625d368375 (diff)
downloadvim-git-a2c45a17c174d815fd1d160f92ec6c277201e111.tar.gz
patch 8.0.0784: job of terminal may be garbage collectedv8.0.0784
Problem: Job of terminal may be garbage collected. Solution: Set copyID on job in terminal. (Ozaki Kiichi)
Diffstat (limited to 'src/terminal.c')
-rw-r--r--src/terminal.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/terminal.c b/src/terminal.c
index 6d8679d39..c4e1a5208 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -1371,6 +1371,26 @@ term_report_winsize(term_T *term, int rows, int cols)
}
}
+/*
+ * Mark references in jobs of terminals.
+ */
+ int
+set_ref_in_term(int copyID)
+{
+ int abort = FALSE;
+ term_T *term;
+ typval_T tv;
+
+ for (term = first_term; term != NULL; term = term->tl_next)
+ if (term->tl_job != NULL)
+ {
+ tv.v_type = VAR_JOB;
+ tv.vval.v_job = term->tl_job;
+ abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL);
+ }
+ return abort;
+}
+
# endif
#endif /* FEAT_TERMINAL */