summaryrefslogtreecommitdiffstats
path: root/src/channel.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-06-20 03:45:36 +0200
committerBram Moolenaar <Bram@vim.org>2019-06-20 03:45:36 +0200
commit75a1a9415b9c207de5a29b25c0d1949c6c9c5c61 (patch)
tree470a0887aed4e52e342edbca555e0bec1b85af99 /src/channel.c
parenta3fce62c911c204ae144b55018f6dc9295088850 (diff)
patch 8.1.1575: callbacks may be garbage collectedv8.1.1575
Problem: Callbacks may be garbage collected. Solution: Set reference in callbacks. (Ozaki Kiichi, closes #4564)
Diffstat (limited to 'src/channel.c')
-rw-r--r--src/channel.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/channel.c b/src/channel.c
index 76c5611454..4e6df94274 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -4479,7 +4479,8 @@ set_ref_in_channel(int copyID)
channel_T *channel;
typval_T tv;
- for (channel = first_channel; channel != NULL; channel = channel->ch_next)
+ for (channel = first_channel; !abort && channel != NULL;
+ channel = channel->ch_next)
if (channel_still_useful(channel))
{
tv.v_type = VAR_CHANNEL;
@@ -5568,7 +5569,7 @@ set_ref_in_job(int copyID)
job_T *job;
typval_T tv;
- for (job = first_job; job != NULL; job = job->jv_next)
+ for (job = first_job; !abort && job != NULL; job = job->jv_next)
if (job_still_useful(job))
{
tv.v_type = VAR_JOB;