Patch 8.1.0847
Problem: May use terminal after it was cleaned up.
Solution: Use the job pointer.
Files: src/terminal.c
*** ../vim-8.1.0846/src/terminal.c 2019-01-29 22:29:03.550799929 +0100
--- src/terminal.c 2019-01-29 23:04:59.930003181 +0100
***************
*** 1375,1393 ****
job_stop(buf->b_term->tl_job, NULL, how);
! /* wait for up to a second for the job to die */
for (count = 0; count < 100; ++count)
{
! /* buffer, terminal and job may be cleaned up while waiting */
if (!buf_valid(buf)
|| buf->b_term == NULL
|| buf->b_term->tl_job == NULL)
return OK;
! /* call job_status() to update jv_status */
! job_status(buf->b_term->tl_job);
! if (buf->b_term->tl_job->jv_status >= JOB_ENDED)
return OK;
ui_delay(10L, FALSE);
mch_check_messages();
parse_queued_messages();
--- 1375,1398 ----
job_stop(buf->b_term->tl_job, NULL, how);
! // wait for up to a second for the job to die
for (count = 0; count < 100; ++count)
{
! job_T *job;
!
! // buffer, terminal and job may be cleaned up while waiting
if (!buf_valid(buf)
|| buf->b_term == NULL
|| buf->b_term->tl_job == NULL)
return OK;
+ job = buf->b_term->tl_job;
! // Call job_status() to update jv_status. It may cause the job to be
! // cleaned up but it won't be freed.
! job_status(job);
! if (job->jv_status >= JOB_ENDED)
return OK;
+
ui_delay(10L, FALSE);
mch_check_messages();
parse_queued_messages();
*** ../vim-8.1.0846/src/version.c 2019-01-29 22:58:02.401136295 +0100
--- src/version.c 2019-01-29 23:06:03.985525682 +0100
***************
*** 785,786 ****
--- 785,788 ----
{ /* Add new patch number below this line */
+ /**/
+ 847,
/**/
--
ARTHUR: I command you as King of the Britons to stand aside!
BLACK KNIGHT: I move for no man.
The Quest for the Holy Grail (Monty Python)
/// Bram Moolenaar -- [email protected] -- 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 ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.