diff options
author | James McCoy <jamessan@jamessan.com> | 2017-01-02 06:39:47 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-02 06:39:47 -0500 |
commit | f7639e249081833e2e0064601bf8327192913636 (patch) | |
tree | f81c4db6f2d319515519f3d9f4b09226148b49de /src | |
parent | c5f4b92ff93a40ec4e77b78d0576903e7a60eefd (diff) | |
parent | 945540b7825e2909d17d8b8867330c3ace7c759c (diff) | |
download | rneovim-f7639e249081833e2e0064601bf8327192913636.tar.gz rneovim-f7639e249081833e2e0064601bf8327192913636.tar.bz2 rneovim-f7639e249081833e2e0064601bf8327192913636.zip |
Merge pull request #5859 from jamessan/vim-7.4.1866
vim-patch:7.4.1866,7.4.1868
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval.c | 5 | ||||
-rw-r--r-- | src/nvim/globals.h | 4 | ||||
-rw-r--r-- | src/nvim/memory.c | 5 | ||||
-rw-r--r-- | src/nvim/version.c | 4 |
4 files changed, 12 insertions, 6 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 32e1991742..f769016936 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -21569,7 +21569,10 @@ void func_unref(char_u *name) if (name != NULL && isdigit(*name)) { fp = find_func(name); if (fp == NULL) { - EMSG2(_(e_intern2), "func_unref()"); +#ifdef EXITFREE + if (!entered_free_all_mem) +#endif + EMSG2(_(e_intern2), "func_unref()"); } else { user_func_unref(fp); } diff --git a/src/nvim/globals.h b/src/nvim/globals.h index fbffc2d44d..bc98971c0b 100644 --- a/src/nvim/globals.h +++ b/src/nvim/globals.h @@ -636,6 +636,10 @@ EXTERN int exiting INIT(= FALSE); /* TRUE when planning to exit Vim. Might * still keep on running if there is a changed * buffer. */ +#if defined(EXITFREE) +// true when in or after free_all_mem() +EXTERN bool entered_free_all_mem INIT(= false); +#endif /* volatile because it is used in signal handler deathtrap(). */ EXTERN volatile int full_screen INIT(= FALSE); /* TRUE when doing full-screen output diff --git a/src/nvim/memory.c b/src/nvim/memory.c index 071ef335cf..ca6aa6381d 100644 --- a/src/nvim/memory.c +++ b/src/nvim/memory.c @@ -488,13 +488,12 @@ void time_to_bytes(time_t time_, uint8_t buf[8]) void free_all_mem(void) { buf_T *buf, *nextbuf; - static bool 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) + if (entered_free_all_mem) return; - entered = true; + entered_free_all_mem = true; // Don't want to trigger autocommands from here on. block_autocmds(); diff --git a/src/nvim/version.c b/src/nvim/version.c index 9f2b7a26c3..61ffb1cae6 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -572,9 +572,9 @@ static int included_patches[] = { 1871, // 1870 NA // 1869 NA - // 1868, + 1868, 1867, - // 1866, + 1866, // 1865 NA // 1864 NA // 1863 NA |