Problem: Invalid memory access when exiting with EXITFREE defined.
(Dominique Pelle)
Solution: Set "really_exiting" and skip error messages.
{
fp = find_func(name);
if (fp == NULL)
- EMSG2(_(e_intern2), "func_unref()");
+ {
+ /* Ignore when invoked through free_all_mem(). */
+ if (!really_exiting)
+ EMSG2(_(e_intern2), "func_unref()");
+ }
else if (--fp->uf_refcount <= 0)
{
/* Only delete it when it's not being used. Otherwise it's done
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. */
block_autocmds();
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1866,
/**/
1865,
/**/