To: vim_dev@googlegroups.com Subject: Patch 8.0.0783 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0783 Problem: Job of terminal may be freed too early. Solution: Increment job refcount. (Yasuhiro Matsumoto) Files: src/terminal.c *** ../vim-8.0.0782/src/terminal.c 2017-07-27 21:46:38.389969291 +0200 --- src/terminal.c 2017-07-27 22:05:02.558158163 +0200 *************** *** 1247,1252 **** --- 1247,1253 ---- 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,1334 **** --- 1330,1337 ---- 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 *** ../vim-8.0.0782/src/version.c 2017-07-27 22:03:45.554703031 +0200 --- src/version.c 2017-07-27 22:06:56.297353599 +0200 *************** *** 771,772 **** --- 771,774 ---- { /* Add new patch number below this line */ + /**/ + 783, /**/ -- In war we're tough and able. Quite indefatigable Between our quests We sequin vests And impersonate Clark Gable It's a busy life in Camelot. I have to push the pram a lot. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///