Patch 7.4.1746
Problem:    Memory leak in Perl.
Solution:   Decrement the reference count.  Add a test. (Damien)
Files:      src/if_perl.xs, src/testdir/test_perl.vim


*** ../vim-7.4.1745/src/if_perl.xs      2016-04-14 14:09:21.712015920 +0200
--- src/if_perl.xs      2016-04-15 21:14:12.849634901 +0200
***************
*** 844,849 ****
--- 844,850 ----
      else
        rv = newBUFrv(newSV(0), curbuf);
      sv_setsv(sv, rv);
+     SvREFCNT_dec(SvRV(rv));
      return 0;
  }
  #endif /* !PROTO */
*** ../vim-7.4.1745/src/testdir/test_perl.vim   2016-04-14 14:09:21.712015920 
+0200
--- src/testdir/test_perl.vim   2016-04-15 21:16:00.368486944 +0200
***************
*** 34,40 ****
    endtry
    call assert_true(0, 'no exception for `perleval("'.a:expr.'")`')
    return ''
! endf
  
  function Test_perleval()
    call assert_false(perleval('undef'))
--- 34,40 ----
    endtry
    call assert_true(0, 'no exception for `perleval("'.a:expr.'")`')
    return ''
! endfunc
  
  function Test_perleval()
    call assert_false(perleval('undef'))
***************
*** 73,79 ****
  
    call assert_equal('*VIM', perleval('"*VIM"'))
    call assert_true(perleval('\\0') =~ 'SCALAR(0x\x\+)')
! endf
  
  function Test_perldo()
    sp __TEST__
--- 73,79 ----
  
    call assert_equal('*VIM', perleval('"*VIM"'))
    call assert_true(perleval('\\0') =~ 'SCALAR(0x\x\+)')
! endfunc
  
  function Test_perldo()
    sp __TEST__
***************
*** 82,88 ****
    1
    call assert_false(search('\Cperl'))
    bw!
! endf
  
  function Test_VIM_package()
    perl VIM::DoCommand('let l:var = "foo"')
--- 82,88 ----
    1
    call assert_false(search('\Cperl'))
    bw!
! endfunc
  
  function Test_VIM_package()
    perl VIM::DoCommand('let l:var = "foo"')
***************
*** 91,97 ****
    set noet
    perl VIM::SetOption('et')
    call assert_true(&et)
! endf
  
  function Test_stdio()
    redir =>l:out
--- 91,97 ----
    set noet
    perl VIM::SetOption('et')
    call assert_true(&et)
! endfunc
  
  function Test_stdio()
    redir =>l:out
***************
*** 102,105 ****
  EOF
    redir END
    call assert_equal(['&VIM::Msg', 'STDOUT', 'STDERR'], split(l:out, "\n"))
! endf
--- 102,123 ----
  EOF
    redir END
    call assert_equal(['&VIM::Msg', 'STDOUT', 'STDERR'], split(l:out, "\n"))
! endfunc
! 
! function Test_SvREFCNT()
!   new t
!   perl <<--perl
!   my ($b, $w);
!   $b = $curbuf for 0 .. 10;
!   $w = $curwin for 0 .. 10;
!   VIM::DoCommand('bw! t');
!   if (exists &Internals::SvREFCNT) {
!       my $cb = Internals::SvREFCNT($$b);
!       my $cw = Internals::SvREFCNT($$w);
!       VIM::Eval("assert_equal(2, $cb)");
!       VIM::Eval("assert_equal(2, $cw)");
!   }
!   VIM::Eval("assert_false($$b)");
!   VIM::Eval("assert_false($$w)");
! --perl
! endfunc
*** ../vim-7.4.1745/src/version.c       2016-04-15 20:54:49.266121108 +0200
--- src/version.c       2016-04-15 21:14:04.921719562 +0200
***************
*** 750,751 ****
--- 750,753 ----
  {   /* Add new patch number below this line */
+ /**/
+     1746,
  /**/

-- 
GALAHAD: No look, really, this isn't nescess ...
PIGLET:  We must examine you.
GALAHAD: There's nothing wrong with ... that.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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