1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-02 07:46:38 +02:00

Fixed crash when closing a buffer opened on many windows

This commit is contained in:
Sebastien Helleu
2007-01-16 23:53:01 +00:00
parent e99915e427
commit 749fae7a75
8 changed files with 40 additions and 30 deletions
+12 -11
View File
@@ -466,6 +466,16 @@ gui_buffer_free (t_gui_buffer *buffer, int switch_to_another)
create_new = (buffer->server || buffer->channel);
if (switch_to_another)
{
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if ((buffer == ptr_win->buffer) &&
((buffer->next_buffer) || (buffer->prev_buffer)))
gui_buffer_switch_previous (ptr_win);
}
}
hotlist_remove_buffer (buffer);
if (hotlist_initial_buffer == buffer)
hotlist_initial_buffer = NULL;
@@ -486,16 +496,6 @@ gui_buffer_free (t_gui_buffer *buffer, int switch_to_another)
ptr_server->saved_buffer = NULL;
}
if (switch_to_another)
{
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if ((buffer == ptr_win->buffer) &&
((buffer->next_buffer) || (buffer->prev_buffer)))
gui_buffer_switch_previous (ptr_win);
}
}
/* decrease buffer number for all next buffers */
for (ptr_buffer = buffer->next_buffer; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
@@ -546,7 +546,8 @@ gui_buffer_free (t_gui_buffer *buffer, int switch_to_another)
(void) gui_buffer_new (gui_windows, NULL, NULL,
BUFFER_TYPE_STANDARD, 1);
gui_status_draw (gui_current_window->buffer, 1);
if (gui_windows && gui_current_window && gui_current_window->buffer)
gui_status_draw (gui_current_window->buffer, 1);
}
/*