1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-01 04:14:16 -04:00

When destroying window, change to different window before destroying

window items so that if they print anything, it won't get lost.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@584 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-08-11 19:57:58 +00:00 committed by cras
parent ead41669db
commit 8eb324accc

View File

@ -107,11 +107,16 @@ void window_destroy(WINDOW_REC *window)
if (window->destroying) return;
window->destroying = TRUE;
windows = g_slist_remove(windows, window);
if (active_win == window && windows != NULL) {
active_win = NULL; /* it's corrupted */
window_set_active(windows->data);
}
while (window->items != NULL)
window_remove_item(window, window->items->data);
windows = g_slist_remove(windows, window);
signal_emit("window destroyed", 1, window);
g_slist_foreach(window->waiting_channels, (GFunc) g_free, NULL);
@ -122,11 +127,6 @@ void window_destroy(WINDOW_REC *window)
g_free_not_null(window->name);
g_free(window);
if (active_win == window && windows != NULL) {
active_win = NULL; /* it's corrupted */
window_set_active(windows->data);
}
windows_pack(refnum);
}