Permalink
Browse files

patch 8.0.0783: job of terminal may be freed too early

Problem:    Job of terminal may be freed too early.
Solution:   Increment job refcount. (Yasuhiro Matsumoto)
  • Loading branch information...
brammool committed Jul 27, 2017
1 parent d28cc3f commit 0e83f02d80acacee55c5de3bbbee52625d368375
Showing with 5 additions and 0 deletions.
  1. +3 −0 src/terminal.c
  2. +2 −0 src/version.c
View
@@ -1247,6 +1247,7 @@ term_and_job_init(term_T *term, int rows, int cols, char_u *cmd)
job->jv_proc_info.dwProcessId = GetProcessId(child_process_handle);
job->jv_job_object = jo;
job->jv_status = JOB_STARTED;
++job->jv_refcount;
term->tl_job = job;
return OK;
@@ -1329,6 +1330,8 @@ term_and_job_init(term_T *term, int rows, int cols, char_u *cmd)
argvars[0].vval.v_string = cmd;
setup_job_options(&opt, rows, cols);
term->tl_job = job_start(argvars, &opt);
if (term->tl_job != NULL)
++term->tl_job->jv_refcount;
return term->tl_job != NULL
&& term->tl_job->jv_channel != NULL
View
@@ -769,6 +769,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
783,
/**/
782,
/**/

0 comments on commit 0e83f02

Please sign in to comment.