Patch 7.4.2359
Problem:    Memory leak in timer_start().
Solution:   Check the right field to be NULL.
Files:      src/evalfunc.c, src/testdir/test_timers.vim


*** ../vim-7.4.2358/src/evalfunc.c      2016-09-05 22:45:25.068731124 +0200
--- src/evalfunc.c      2016-09-10 13:39:30.553135957 +0200
***************
*** 12429,12435 ****
        free_callback(callback, partial);
      else
      {
!       if (timer->tr_partial == NULL)
            timer->tr_callback = vim_strsave(callback);
        else
            /* pointer into the partial */
--- 12429,12435 ----
        free_callback(callback, partial);
      else
      {
!       if (partial == NULL)
            timer->tr_callback = vim_strsave(callback);
        else
            /* pointer into the partial */
*** ../vim-7.4.2358/src/testdir/test_timers.vim 2016-09-05 22:45:25.072731086 
+0200
--- src/testdir/test_timers.vim 2016-09-10 13:40:34.604269892 +0200
***************
*** 48,59 ****
  
  func Test_with_partial_callback()
    let g:val = 0
!   let s:meow = {}
!   function s:meow.bite(...)
!     let g:val += 1
    endfunction
  
!   call timer_start(50, s:meow.bite)
    let slept = WaitFor('g:val == 1')
    call assert_equal(1, g:val)
    if has('reltime')
--- 48,59 ----
  
  func Test_with_partial_callback()
    let g:val = 0
!   let meow = {'one': 1}
!   function meow.bite(...)
!     let g:val += self.one
    endfunction
  
!   call timer_start(50, meow.bite)
    let slept = WaitFor('g:val == 1')
    call assert_equal(1, g:val)
    if has('reltime')
*** ../vim-7.4.2358/src/version.c       2016-09-09 22:13:00.797409881 +0200
--- src/version.c       2016-09-10 14:27:05.830340786 +0200
***************
*** 765,766 ****
--- 765,768 ----
  {   /* Add new patch number below this line */
+ /**/
+     2359,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
220. Your wife asks for sex and you tell her where to find you on IRC.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui