1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

Still some window closing bugs/crashes.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2225 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-12-09 14:03:44 +00:00 committed by cras
parent ac8109ac9e
commit 6a1f6b560f

View File

@ -129,7 +129,7 @@ static GSList *get_sticky_windows_sorted(MAIN_WINDOW_REC *mainwin)
void mainwindow_change_active(MAIN_WINDOW_REC *mainwin, void mainwindow_change_active(MAIN_WINDOW_REC *mainwin,
WINDOW_REC *skip_window) WINDOW_REC *skip_window)
{ {
WINDOW_REC *window; WINDOW_REC *window, *other;
GSList *tmp; GSList *tmp;
mainwin->active = NULL; mainwin->active = NULL;
@ -149,16 +149,21 @@ void mainwindow_change_active(MAIN_WINDOW_REC *mainwin,
} }
} }
other = NULL;
for (tmp = windows; tmp != NULL; tmp = tmp->next) { for (tmp = windows; tmp != NULL; tmp = tmp->next) {
WINDOW_REC *rec = tmp->data; WINDOW_REC *rec = tmp->data;
if (rec != skip_window && WINDOW_MAIN(rec) != mainwin) { if (rec != skip_window) {
window_set_active(rec); if (WINDOW_MAIN(rec) == mainwin) {
break; window_set_active(rec);
return;
}
other = rec;
} }
} }
/* no more non-sticky windows, remove main window */ /* no more non-sticky windows, remove main window */
window_set_active(other);
mainwindow_destroy(mainwin); mainwindow_destroy(mainwin);
} }