diff options
author | Michael Ennen <mike.ennen@gmail.com> | 2017-01-05 17:13:23 -0700 |
---|---|---|
committer | Michael Ennen <mike.ennen@gmail.com> | 2017-02-14 17:38:15 -0700 |
commit | b0fc6108c923a198325354ae36b71f90c4c68e19 (patch) | |
tree | a23ea1020ceb97388d465964fd0e87533aa61438 /src/nvim/getchar.c | |
parent | 64c375c589437b811027c5602ecd3969edc162cb (diff) | |
download | rneovim-b0fc6108c923a198325354ae36b71f90c4c68e19.tar.gz rneovim-b0fc6108c923a198325354ae36b71f90c4c68e19.tar.bz2 rneovim-b0fc6108c923a198325354ae36b71f90c4c68e19.zip |
vim-patch:7.4.1727
Problem: Cannot detect a crash in tests when caused by garbagecollect().
Solution: Add garbagecollect_for_testing(). Do not free a job if is still
useful.
https://github.com/vim/vim/commit/ebf7dfa6f121c82f97d2adca3d45fbaba9ad8f7e
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r-- | src/nvim/getchar.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index fccbd69dbf..fe889eb860 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -1327,8 +1327,9 @@ int using_script(void) void before_blocking(void) { updatescript(0); - if (may_garbage_collect) - garbage_collect(); + if (may_garbage_collect) { + garbage_collect(false); + } } /* @@ -1366,10 +1367,11 @@ int vgetc(void) char_u buf[MB_MAXBYTES + 1]; int i; - /* Do garbage collection when garbagecollect() was called previously and - * we are now at the toplevel. */ - if (may_garbage_collect && want_garbage_collect) - garbage_collect(); + // Do garbage collection when garbagecollect() was called previously and + // we are now at the toplevel. + if (may_garbage_collect && want_garbage_collect) { + garbage_collect(false); + } /* * If a character was put back with vungetc, it was already processed. |