summaryrefslogtreecommitdiff
path: root/src/misc2.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-10-23 21:53:30 +0200
committerBram Moolenaar <Bram@vim.org>2017-10-23 21:53:30 +0200
commit4f1982800f0aff28df6875e718a786f6c4b11ad9 (patch)
tree0cda1a53ffa28cd3bb662507ebff7ee1a1221def /src/misc2.c
parent2e4cb3b042faba5efc9b5a8b4f86942a417494ce (diff)
downloadvim-git-4f1982800f0aff28df6875e718a786f6c4b11ad9.tar.gz
patch 8.0.1214: accessing freed memory when EXITFREE is setv8.0.1214
Problem: Accessing freed memory when EXITFREE is set and there is more than one tab and window. (Dominique Pelle) Solution: Free options later. Skip redraw when exiting.
Diffstat (limited to 'src/misc2.c')
-rw-r--r--src/misc2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/misc2.c b/src/misc2.c
index fac44c737..52ce097a8 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -1135,7 +1135,6 @@ free_all_mem(void)
free_all_autocmds();
# endif
clear_termcodes();
- free_all_options();
free_all_marks();
alist_clear(&global_alist);
free_homedir();
@@ -1196,6 +1195,9 @@ free_all_mem(void)
/* Destroy all windows. Must come before freeing buffers. */
win_free_all();
+ /* Free all option values. Must come after closing windows. */
+ free_all_options();
+
/* Free all buffers. Reset 'autochdir' to avoid accessing things that
* were freed already. */
#ifdef FEAT_AUTOCHDIR