Problem: Crash when using partial with a timer.
Solution: Increment partial reference count. (Hirohito Higashi)
if (arg->v_type == VAR_PARTIAL && arg->vval.v_partial != NULL)
{
*pp = arg->vval.v_partial;
+ ++(*pp)->pt_refcount;
return (*pp)->pt_name;
}
*pp = NULL;
call assert_true(s:val > 1)
call assert_true(s:val < 5)
endfunc
+
+func Test_with_partial_callback()
+ let s:val = 0
+ let s:meow = {}
+ function s:meow.bite(...)
+ let s:val += 1
+ endfunction
+
+ call timer_start(50, s:meow.bite)
+ sleep 200m
+ call assert_equal(1, s:val)
+endfunc
+" vim: ts=2 sw=0 et
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1656,
/**/
1655,
/**/