Permalink
Browse files

patch 8.0.0784: job of terminal may be garbage collected

Problem:    Job of terminal may be garbage collected.
Solution:   Set copyID on job in terminal. (Ozaki Kiichi)
  • Loading branch information...
brammool committed Jul 27, 2017
1 parent 0e83f02 commit a2c45a17c174d815fd1d160f92ec6c277201e111
Showing with 27 additions and 0 deletions.
  1. +4 −0 src/eval.c
  2. +1 −0 src/proto/terminal.pro
  3. +20 −0 src/terminal.c
  4. +2 −0 src/version.c
View
@@ -5329,6 +5329,10 @@ garbage_collect(int testing)
abort = abort || set_ref_in_quickfix(copyID);
#endif
#ifdef FEAT_TERMINAL
abort = abort || set_ref_in_term(copyID);
#endif
if (!abort)
{
/*
View
@@ -6,4 +6,5 @@ void terminal_loop(void);
void term_job_ended(job_T *job);
void term_update_window(win_T *wp);
char_u *term_get_status_text(term_T *term);
int set_ref_in_term(int copyID);
/* vim: set ft=c : */
View
@@ -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 */
View
@@ -769,6 +769,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
784,
/**/
783,
/**/

0 comments on commit a2c45a1

Please sign in to comment.