diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-04-08 17:07:19 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-04-08 17:07:19 +0200 |
commit | 107e1eef1df3b786ad3ad49fbdb9e058649303b5 (patch) | |
tree | 1b645e4de0cc6a8021a5c48ca97897edf7e48adf /src/testdir/test_partial.vim | |
parent | d56374e25df0b317b01423a01f158157faa647fa (diff) | |
download | vim-git-107e1eef1df3b786ad3ad49fbdb9e058649303b5.tar.gz |
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/testdir/test_partial.vim')
-rw-r--r-- | src/testdir/test_partial.vim | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/testdir/test_partial.vim b/src/testdir/test_partial.vim index 2d53e8207..404bb748d 100644 --- a/src/testdir/test_partial.vim +++ b/src/testdir/test_partial.vim @@ -221,7 +221,7 @@ func Test_bind_in_python() endif endfunc -" This causes double free on exit if EXITFREE is defined. +" This caused double free on exit if EXITFREE is defined. func Test_cyclic_list_arg() let l = [] let Pt = function('string', [l]) @@ -230,7 +230,7 @@ func Test_cyclic_list_arg() unlet Pt endfunc -" This causes double free on exit if EXITFREE is defined. +" This caused double free on exit if EXITFREE is defined. func Test_cyclic_dict_arg() let d = {} let Pt = function('string', [d]) @@ -238,3 +238,18 @@ func Test_cyclic_dict_arg() unlet d unlet Pt endfunc + +func Ignored(job1, job2, status) +endfunc + +func Test_cycle_partial_job() + let job = job_start('echo') + call job_setoptions(job, {'exit_cb': function('Ignored', [job])}) + unlet job +endfunc + +func Test_ref_job_partial_dict() + let g:ref_job = job_start('echo') + let d = {'a': 'b'} + call job_setoptions(g:ref_job, {'exit_cb': function('string', [], d)}) +endfunc |