Dominique Pelle wrote:

> Command custom completion (:help :command-completion-customlist)
> is leaking memory when redefining completion for a command
> multiple times. I see this bug in latest Vim-7.2.132.
> 
> The following script illustrates the problem: memory usage keeps
> growing at each iteration when redefining a command completion:
> 
>   :function! s:Foo()
>   :endfunction
> 
>   :function! s:CompleteFoo(a, l, p)
>   :endfunction
> 
>   :while 1
>   :  " Leak at each iteration
>   :  command! -complete=customlist,s:CompleteFoo -nargs=1 Foo :call s:Foo()
>   :endwhile
> 
> Attached patch fixes the memory leak.

Thanks!  I'll move the vim_free() call to where uc_rep is freed, they
belong together.

-- 
What is the difference between a professional and an amateur?
The ark was built by an amateur; professionals gave us the Titanic.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui