Mercurial > vim
comparison src/testdir/test_channel.vim @ 8859:03250bc0c63a v7.4.1717
commit https://github.com/vim/vim/commit/0e4c1de5560c7f8b4cae539ec8cff0949daba3fc
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Apr 7 21:40:38 2016 +0200
patch 7.4.1717
Problem: Leaking memory when opening a channel fails.
Solution: Unreference partials in job options.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 07 Apr 2016 21:45:05 +0200 |
parents | 176647a751d7 |
children | ed0b39dd7fd6 |
comparison
equal
deleted
inserted
replaced
8858:593b17f02b78 | 8859:03250bc0c63a |
---|---|
1229 func Test_job_start_invalid() | 1229 func Test_job_start_invalid() |
1230 call assert_fails('call job_start($x)', 'E474:') | 1230 call assert_fails('call job_start($x)', 'E474:') |
1231 call assert_fails('call job_start("")', 'E474:') | 1231 call assert_fails('call job_start("")', 'E474:') |
1232 endfunc | 1232 endfunc |
1233 | 1233 |
1234 " This leaking memory. | |
1235 func Test_partial_in_channel_cycle() | |
1236 let d = {} | |
1237 let d.a = function('string', [d]) | |
1238 try | |
1239 let d.b = ch_open('nowhere:123', {'close_cb': d.a}) | |
1240 catch | |
1241 call assert_exception('E901:') | |
1242 endtry | |
1243 unlet d | |
1244 endfunc | |
1245 | |
1234 " Uncomment this to see what happens, output is in src/testdir/channellog. | 1246 " Uncomment this to see what happens, output is in src/testdir/channellog. |
1235 " call ch_logfile('channellog', 'w') | 1247 " call ch_logfile('channellog', 'w') |