mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 7.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.
This commit is contained in:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user