summaryrefslogtreecommitdiffstats
path: root/src/structs.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-04-08 17:07:19 +0200
committerBram Moolenaar <Bram@vim.org>2016-04-08 17:07:19 +0200
commit107e1eef1df3b786ad3ad49fbdb9e058649303b5 (patch)
tree1b645e4de0cc6a8021a5c48ca97897edf7e48adf /src/structs.h
parentd56374e25df0b317b01423a01f158157faa647fa (diff)
patch 7.4.1719v7.4.1719
Problem: Leaking memory when there is a cycle involving a job and a partial. Solution: Add a copyID to job and channel. Set references in items referred by them. Go through all jobs and channels to find unreferenced items. Also, decrement reference counts when garbage collecting.
Diffstat (limited to 'src/structs.h')
-rw-r--r--src/structs.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/structs.h b/src/structs.h
index e753860b82..adee3e807e 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -1290,6 +1290,8 @@ struct jobvar_S
buf_T *jv_in_buf; /* buffer from "in-name" */
int jv_refcount; /* reference count */
+ int jv_copyID;
+
channel_T *jv_channel; /* channel for I/O, reference counted */
};
@@ -1425,11 +1427,12 @@ struct channel_S {
job_T *ch_job; /* Job that uses this channel; this does not
* count as a reference to avoid a circular
- * reference. */
+ * reference, the job refers to the channel. */
int ch_job_killed; /* TRUE when there was a job and it was killed
* or we know it died. */
int ch_refcount; /* reference count */
+ int ch_copyID;
};
#define JO_MODE 0x0001 /* channel mode */