]> granicus.if.org Git - vim/commitdiff
patch 7.4.1866 v7.4.1866
authorBram Moolenaar <Bram@vim.org>
Wed, 1 Jun 2016 20:21:06 +0000 (22:21 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 1 Jun 2016 20:21:06 +0000 (22:21 +0200)
Problem:    Invalid memory access when exiting with EXITFREE defined.
            (Dominique Pelle)
Solution:   Set "really_exiting" and skip error messages.

src/eval.c
src/misc2.c
src/version.c

index 3d0abf3692e3445598656fe6a71b0d76a12b2848..a49d54bd056bd39271286901ddc94d9e011acaee 100644 (file)
@@ -25348,7 +25348,11 @@ func_unref(char_u *name)
     {
        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
index b4e94795f193ec1cefb3215b7ce4e169bb6fd247..f7b1de30d5465ed92c2674f3904a6a7eff0848b9 100644 (file)
@@ -1044,6 +1044,9 @@ free_all_mem(void)
        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();
index 7952a140c57701d32e61f70957ed12b04577c8ec..f9305d515f39be2c0d1c1ae38743fd134caa31c0 100644 (file)
@@ -753,6 +753,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1866,
 /**/
     1865,
 /**/