mirror of
https://github.com/irssi/irssi.git
synced 2025-02-02 15:08:01 -05: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:
parent
ead41669db
commit
8eb324accc
@ -107,11 +107,16 @@ void window_destroy(WINDOW_REC *window)
|
|||||||
|
|
||||||
if (window->destroying) return;
|
if (window->destroying) return;
|
||||||
window->destroying = TRUE;
|
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)
|
while (window->items != NULL)
|
||||||
window_remove_item(window, window->items->data);
|
window_remove_item(window, window->items->data);
|
||||||
|
|
||||||
windows = g_slist_remove(windows, window);
|
|
||||||
signal_emit("window destroyed", 1, window);
|
signal_emit("window destroyed", 1, window);
|
||||||
|
|
||||||
g_slist_foreach(window->waiting_channels, (GFunc) g_free, NULL);
|
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_not_null(window->name);
|
||||||
g_free(window);
|
g_free(window);
|
||||||
|
|
||||||
if (active_win == window && windows != NULL) {
|
|
||||||
active_win = NULL; /* it's corrupted */
|
|
||||||
window_set_active(windows->data);
|
|
||||||
}
|
|
||||||
|
|
||||||
windows_pack(refnum);
|
windows_pack(refnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user