mirror of
https://github.com/neovim/neovim.git
synced 2026-04-05 07:09:23 +00:00
vim-patch:8.1.1259: crash when exiting early (#35552)
Problem: Crash when exiting early. (Ralf Schandl)
Solution: Only pop/push the title when it was set. (closes vim/vim#4334)
e5c83286bb
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -863,7 +863,7 @@ void free_all_mem(void)
|
|||||||
|
|
||||||
// Close all tabs and windows. Reset 'equalalways' to avoid redraws.
|
// Close all tabs and windows. Reset 'equalalways' to avoid redraws.
|
||||||
p_ea = false;
|
p_ea = false;
|
||||||
if (first_tabpage->tp_next != NULL) {
|
if (first_tabpage != NULL && first_tabpage->tp_next != NULL) {
|
||||||
do_cmdline_cmd("tabonly!");
|
do_cmdline_cmd("tabonly!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -873,18 +873,20 @@ void free_all_mem(void)
|
|||||||
// Clear user commands (before deleting buffers).
|
// Clear user commands (before deleting buffers).
|
||||||
ex_comclear(NULL);
|
ex_comclear(NULL);
|
||||||
|
|
||||||
// Clear menus.
|
if (curbuf != NULL) {
|
||||||
do_cmdline_cmd("aunmenu *");
|
// Clear menus.
|
||||||
do_cmdline_cmd("tlunmenu *");
|
do_cmdline_cmd("aunmenu *");
|
||||||
do_cmdline_cmd("menutranslate clear");
|
do_cmdline_cmd("tlunmenu *");
|
||||||
|
do_cmdline_cmd("menutranslate clear");
|
||||||
|
|
||||||
// Clear mappings, abbreviations, breakpoints.
|
// Clear mappings, abbreviations, breakpoints.
|
||||||
// NB: curbuf not used with local=false arg
|
// NB: curbuf not used with local=false arg
|
||||||
map_clear_mode(curbuf, MAP_ALL_MODES, false, false);
|
map_clear_mode(curbuf, MAP_ALL_MODES, false, false);
|
||||||
map_clear_mode(curbuf, MAP_ALL_MODES, false, true);
|
map_clear_mode(curbuf, MAP_ALL_MODES, false, true);
|
||||||
do_cmdline_cmd("breakdel *");
|
do_cmdline_cmd("breakdel *");
|
||||||
do_cmdline_cmd("profdel *");
|
do_cmdline_cmd("profdel *");
|
||||||
do_cmdline_cmd("set keymap=");
|
do_cmdline_cmd("set keymap=");
|
||||||
|
}
|
||||||
|
|
||||||
free_titles();
|
free_titles();
|
||||||
free_findfile();
|
free_findfile();
|
||||||
@@ -905,7 +907,9 @@ void free_all_mem(void)
|
|||||||
free_cd_dir();
|
free_cd_dir();
|
||||||
free_signs();
|
free_signs();
|
||||||
set_expr_line(NULL);
|
set_expr_line(NULL);
|
||||||
diff_clear(curtab);
|
if (curtab != NULL) {
|
||||||
|
diff_clear(curtab);
|
||||||
|
}
|
||||||
clear_sb_text(true); // free any scrollback text
|
clear_sb_text(true); // free any scrollback text
|
||||||
|
|
||||||
// Free some global vars.
|
// Free some global vars.
|
||||||
@@ -922,8 +926,10 @@ void free_all_mem(void)
|
|||||||
// Close all script inputs.
|
// Close all script inputs.
|
||||||
close_all_scripts();
|
close_all_scripts();
|
||||||
|
|
||||||
// Destroy all windows. Must come before freeing buffers.
|
if (curwin != NULL) {
|
||||||
win_free_all();
|
// Destroy all windows. Must come before freeing buffers.
|
||||||
|
win_free_all();
|
||||||
|
}
|
||||||
|
|
||||||
// Free all option values. Must come after closing windows.
|
// Free all option values. Must come after closing windows.
|
||||||
free_all_options();
|
free_all_options();
|
||||||
@@ -957,8 +963,10 @@ void free_all_mem(void)
|
|||||||
|
|
||||||
reset_last_sourcing();
|
reset_last_sourcing();
|
||||||
|
|
||||||
free_tabpage(first_tabpage);
|
if (first_tabpage != NULL) {
|
||||||
first_tabpage = NULL;
|
free_tabpage(first_tabpage);
|
||||||
|
first_tabpage = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// message history
|
// message history
|
||||||
msg_hist_clear(0);
|
msg_hist_clear(0);
|
||||||
|
|||||||
@@ -2453,7 +2453,9 @@ static bool found_tagfile_cb(int num_fnames, char **fnames, bool all, void *cook
|
|||||||
void free_tag_stuff(void)
|
void free_tag_stuff(void)
|
||||||
{
|
{
|
||||||
ga_clear_strings(&tag_fnames);
|
ga_clear_strings(&tag_fnames);
|
||||||
do_tag(NULL, DT_FREE, 0, 0, 0);
|
if (curwin != NULL) {
|
||||||
|
do_tag(NULL, DT_FREE, 0, 0, 0);
|
||||||
|
}
|
||||||
tag_freematch();
|
tag_freematch();
|
||||||
|
|
||||||
tagstack_clear_entry(&ptag_entry);
|
tagstack_clear_entry(&ptag_entry);
|
||||||
|
|||||||
@@ -1053,7 +1053,9 @@ theend:
|
|||||||
void ex_comclear(exarg_T *eap)
|
void ex_comclear(exarg_T *eap)
|
||||||
{
|
{
|
||||||
uc_clear(&ucmds);
|
uc_clear(&ucmds);
|
||||||
uc_clear(&curbuf->b_ucmds);
|
if (curbuf != NULL) {
|
||||||
|
uc_clear(&curbuf->b_ucmds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void free_ucmd(ucmd_T *cmd)
|
void free_ucmd(ucmd_T *cmd)
|
||||||
|
|||||||
Reference in New Issue
Block a user