Problem: Memory leak in timer_start().
Solution: Check the right field to be NULL.
free_callback(callback, partial);
else
{
- if (timer->tr_partial == NULL)
+ if (partial == NULL)
timer->tr_callback = vim_strsave(callback);
else
/* pointer into the partial */
func Test_with_partial_callback()
let g:val = 0
- let s:meow = {}
- function s:meow.bite(...)
- let g:val += 1
+ let meow = {'one': 1}
+ function meow.bite(...)
+ let g:val += self.one
endfunction
- call timer_start(50, s:meow.bite)
+ call timer_start(50, meow.bite)
let slept = WaitFor('g:val == 1')
call assert_equal(1, g:val)
if has('reltime')
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2359,
/**/
2358,
/**/