comparison src/channel.c @ 17151:ebe9aab81898 v8.1.1575

patch 8.1.1575: callbacks may be garbage collected commit https://github.com/vim/vim/commit/75a1a9415b9c207de5a29b25c0d1949c6c9c5c61 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jun 20 03:45:36 2019 +0200 patch 8.1.1575: callbacks may be garbage collected Problem: Callbacks may be garbage collected. Solution: Set reference in callbacks. (Ozaki Kiichi, closes https://github.com/vim/vim/issues/4564)
author Bram Moolenaar <Bram@vim.org>
date Thu, 20 Jun 2019 04:00:07 +0200
parents 727f8cc87a45
children cee12488e4bc
comparison
equal deleted inserted replaced
17150:96373bb9c0eb 17151:ebe9aab81898
4477 { 4477 {
4478 int abort = FALSE; 4478 int abort = FALSE;
4479 channel_T *channel; 4479 channel_T *channel;
4480 typval_T tv; 4480 typval_T tv;
4481 4481
4482 for (channel = first_channel; channel != NULL; channel = channel->ch_next) 4482 for (channel = first_channel; !abort && channel != NULL;
4483 channel = channel->ch_next)
4483 if (channel_still_useful(channel)) 4484 if (channel_still_useful(channel))
4484 { 4485 {
4485 tv.v_type = VAR_CHANNEL; 4486 tv.v_type = VAR_CHANNEL;
4486 tv.vval.v_channel = channel; 4487 tv.vval.v_channel = channel;
4487 abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL); 4488 abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL);
5566 { 5567 {
5567 int abort = FALSE; 5568 int abort = FALSE;
5568 job_T *job; 5569 job_T *job;
5569 typval_T tv; 5570 typval_T tv;
5570 5571
5571 for (job = first_job; job != NULL; job = job->jv_next) 5572 for (job = first_job; !abort && job != NULL; job = job->jv_next)
5572 if (job_still_useful(job)) 5573 if (job_still_useful(job))
5573 { 5574 {
5574 tv.v_type = VAR_JOB; 5575 tv.v_type = VAR_JOB;
5575 tv.vval.v_job = job; 5576 tv.vval.v_job = job;
5576 abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL); 5577 abort = abort || set_ref_in_item(&tv, copyID, NULL, NULL);