vim-patch:8.0.1214: accessing freed memory when EXITFREE is set

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.
4f1982800f
This commit is contained in:
Jan Edmund Lazo 2018-08-25 10:40:27 -04:00
parent 13f028e416
commit e85bed0830
2 changed files with 4 additions and 2 deletions

View File

@ -619,7 +619,6 @@ void free_all_mem(void)
/* Obviously named calls. */ /* Obviously named calls. */
free_all_autocmds(); free_all_autocmds();
free_all_options();
free_all_marks(); free_all_marks();
alist_clear(&global_alist); alist_clear(&global_alist);
free_homedir(); free_homedir();
@ -657,6 +656,9 @@ void free_all_mem(void)
/* Destroy all windows. Must come before freeing buffers. */ /* Destroy all windows. Must come before freeing buffers. */
win_free_all(); win_free_all();
// Free all option values. Must come after closing windows.
free_all_options();
free_cmdline_buf(); free_cmdline_buf();
/* Clear registers. */ /* Clear registers. */

View File

@ -149,7 +149,7 @@ void redraw_later(int type)
void redraw_win_later(win_T *wp, int type) void redraw_win_later(win_T *wp, int type)
{ {
if (wp->w_redr_type < type) { if (!exiting && wp->w_redr_type < type) {
wp->w_redr_type = type; wp->w_redr_type = type;
if (type >= NOT_VALID) if (type >= NOT_VALID)
wp->w_lines_valid = 0; wp->w_lines_valid = 0;