1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-28 01:35:32 +00: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:
Jonas Fonseca 2006-08-14 16:10:24 +02:00 committed by Jonas Fonseca
parent 0cca8d4af0
commit c8c8325092

View File

@ -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);
}