File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -1375,19 +1375,24 @@ term_try_stop_job(buf_T *buf)
13751375
13761376 job_stop (buf -> b_term -> tl_job , NULL , how );
13771377
1378- /* wait for up to a second for the job to die */
1378+ // wait for up to a second for the job to die
13791379 for (count = 0 ; count < 100 ; ++ count )
13801380 {
1381- /* buffer, terminal and job may be cleaned up while waiting */
1381+ job_T * job ;
1382+
1383+ // buffer, terminal and job may be cleaned up while waiting
13821384 if (!buf_valid (buf )
13831385 || buf -> b_term == NULL
13841386 || buf -> b_term -> tl_job == NULL )
13851387 return OK ;
1388+ job = buf -> b_term -> tl_job ;
13861389
1387- /* call job_status() to update jv_status */
1388- job_status (buf -> b_term -> tl_job );
1389- if (buf -> b_term -> tl_job -> jv_status >= JOB_ENDED )
1390+ // Call job_status() to update jv_status. It may cause the job to be
1391+ // cleaned up but it won't be freed.
1392+ job_status (job );
1393+ if (job -> jv_status >= JOB_ENDED )
13901394 return OK ;
1395+
13911396 ui_delay (10L , FALSE);
13921397 mch_check_messages ();
13931398 parse_queued_messages ();
Original file line number Diff line number Diff line change @@ -783,6 +783,8 @@ static char *(features[]) =
783783
784784static int included_patches [] =
785785{ /* Add new patch number below this line */
786+ /**/
787+ 847 ,
786788/**/
787789 846 ,
788790/**/
You can’t perform that action at this time.
0 commit comments