mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Fix assertion failure related to closing all tabs but the current
Decrement term->current_tab before calling delete_window() instead of after deleting all backgrounded tabs, so get_tab_by_number() will see a consistent value.
This commit is contained in:
parent
0cca8d4af0
commit
c8c8325092
@ -223,11 +223,17 @@ really_close_tabs(struct session *ses)
|
||||
|
||||
foreach_tab (tab, term->windows) {
|
||||
if (tab == current) continue;
|
||||
|
||||
/* Update the current tab counter so assertions in the
|
||||
* delete_window() call-chain will hold, namely the one in
|
||||
* get_tab_by_number(). */
|
||||
if (term->current_tab > 0)
|
||||
term->current_tab--;
|
||||
|
||||
tab = tab->prev;
|
||||
delete_window(tab->next);
|
||||
}
|
||||
|
||||
term->current_tab = 0;
|
||||
redraw_terminal(term);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user