Patch 7.4.1868
Problem: Setting really_exiting causes memory leaks to be reported.
Solution: Add the in_free_all_mem flag.
Files: src/globals.h, src/misc2.c, src/eval.c
*** ../vim-7.4.1867/src/globals.h 2016-04-29 22:58:25.618876680 +0200
--- src/globals.h 2016-06-01 23:03:33.033425661 +0200
***************
*** 635,640 ****
--- 635,644 ----
EXTERN int really_exiting INIT(= FALSE);
/* TRUE when we are sure to exit, e.g., after
* a deadly signal */
+ #if defined(EXITFREE)
+ EXTERN int entered_free_all_mem INIT(= FALSE);
+ /* TRUE when in or after free_all_mem() */
+ #endif
/* volatile because it is used in signal handler deathtrap(). */
EXTERN volatile int full_screen INIT(= FALSE);
/* TRUE when doing full-screen output
*** ../vim-7.4.1867/src/misc2.c 2016-06-01 22:21:02.169460750 +0200
--- src/misc2.c 2016-06-01 23:03:43.101425523 +0200
***************
*** 1036,1051 ****
free_all_mem(void)
{
buf_T *buf, *nextbuf;
- static int entered = FALSE;
/* When we cause a crash here it is caught and Vim tries to exit cleanly.
* Don't try freeing everything again. */
! if (entered)
return;
! entered = TRUE;
!
! /* Set this flag to indicate some errors can be ignored. */
! really_exiting = TRUE;
# ifdef FEAT_AUTOCMD
/* Don't want to trigger autocommands from here on. */
--- 1036,1047 ----
free_all_mem(void)
{
buf_T *buf, *nextbuf;
/* When we cause a crash here it is caught and Vim tries to exit cleanly.
* Don't try freeing everything again. */
! if (entered_free_all_mem)
return;
! entered_free_all_mem = TRUE;
# ifdef FEAT_AUTOCMD
/* Don't want to trigger autocommands from here on. */
*** ../vim-7.4.1867/src/eval.c 2016-06-01 22:34:44.809449434 +0200
--- src/eval.c 2016-06-01 23:04:06.617425199 +0200
***************
*** 25350,25357 ****
fp = find_func(name);
if (fp == NULL)
{
! /* Ignore when invoked through free_all_mem(). */
! if (!really_exiting)
EMSG2(_(e_intern2), "func_unref()");
}
else if (--fp->uf_refcount <= 0)
--- 25350,25358 ----
fp = find_func(name);
if (fp == NULL)
{
! #ifdef EXITFREE
! if (!entered_free_all_mem)
! #endif
EMSG2(_(e_intern2), "func_unref()");
}
else if (--fp->uf_refcount <= 0)
*** ../vim-7.4.1867/src/version.c 2016-06-01 22:34:44.809449434 +0200
--- src/version.c 2016-06-01 23:07:43.797422212 +0200
***************
*** 755,756 ****
--- 755,758 ----
{ /* Add new patch number below this line */
+ /**/
+ 1868,
/**/
--
hundred-and-one symptoms of being an internet addict:
32. You don't know what sex three of your closest friends are, because they
have neutral nicknames and you never bothered to ask.
/// 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 ///
/// 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.