1
0
forked from aniani/vim

patch 7.4.1261

Problem:    Pending channel messages are garbage collected. Leaking memory in
            ch_sendexpr().  Leaking memory for a decoded JSON string.
Solution:   Mark the message list as used. Free the encoded JSON.  Don't save
            the JSON string.
This commit is contained in:
Bram Moolenaar
2016-02-04 22:49:49 +01:00
parent a8343c1808
commit 4b6a6dcbe7
5 changed files with 34 additions and 4 deletions

View File

@@ -1315,4 +1315,29 @@ channel_parse_messages(void)
return ret;
}
int
set_ref_in_channel(int copyID)
{
int i;
int abort = FALSE;
for (i = 0; i < channel_count; ++i)
{
jsonq_T *head = &channels[i].ch_json_head;
jsonq_T *item = head->next;
while (item != head)
{
list_T *l = item->value->vval.v_list;
if (l->lv_copyID != copyID)
{
l->lv_copyID = copyID;
abort = abort || set_ref_in_list(l, copyID, NULL);
}
item = item->next;
}
}
return abort;
}
#endif /* FEAT_CHANNEL */