Skip to content

Commit 31440a1

Browse files
committed
patch 7.4.2132
Problem: test_partial has memory leaks reported. Solution: Add a note about why this happens.
1 parent 57e69ff commit 31440a1

2 files changed

Lines changed: 24 additions & 19 deletions

File tree

src/testdir/test_partial.vim

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
11
" Test binding arguments to a Funcref.
2+
3+
" NOTE: This function may cause memory leaks to be reported.
4+
" That is because when fork/exec fails memory is not freed. Since the process
5+
" exists right away it's not a real leak.
6+
func Test_job_start_fails()
7+
if has('job')
8+
let job = job_start('axdfxsdf')
9+
for i in range(100)
10+
let status = job_status(job)
11+
if status == 'dead' || status == 'fail'
12+
break
13+
endif
14+
sleep 10m
15+
endfor
16+
if has('unix')
17+
call assert_equal('dead', job_status(job))
18+
else
19+
call assert_equal('fail', job_status(job))
20+
endif
21+
unlet job
22+
endif
23+
endfunc
224

325
func MyFunc(arg1, arg2, arg3)
426
return a:arg1 . '/' . a:arg2 . '/' . a:arg3
@@ -271,25 +293,6 @@ func Test_cycle_partial_job()
271293
endif
272294
endfunc
273295

274-
func Test_job_start_fails()
275-
if has('job')
276-
let job = job_start('axdfxsdf')
277-
for i in range(100)
278-
let status = job_status(job)
279-
if status == 'dead' || status == 'fail'
280-
break
281-
endif
282-
sleep 10m
283-
endfor
284-
if has('unix')
285-
call assert_equal('dead', job_status(job))
286-
else
287-
call assert_equal('fail', job_status(job))
288-
endif
289-
unlet job
290-
endif
291-
endfunc
292-
293296
func Test_ref_job_partial_dict()
294297
if has('job')
295298
let g:ref_job = job_start('echo')

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,8 @@ static char *(features[]) =
763763

764764
static int included_patches[] =
765765
{ /* Add new patch number below this line */
766+
/**/
767+
2132,
766768
/**/
767769
2131,
768770
/**/

0 commit comments

Comments
 (0)