1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 13:56:37 +02:00

Fix crash on /quit when scrolling in buffer and if first line displayed was from a plugin

This commit is contained in:
Sebastien Helleu
2010-04-14 19:24:54 +02:00
parent 42b9038919
commit 1dba2c8c92
+12 -11
View File
@@ -501,8 +501,20 @@ gui_line_remove_from_list (struct t_gui_buffer *buffer,
struct t_gui_line *line,
int free_data)
{
struct t_gui_window *ptr_win;
int update_prefix_max_length;
/* reset scroll for any window starting with this line */
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if (ptr_win->start_line == line)
{
ptr_win->start_line = ptr_win->start_line->next_line;
ptr_win->start_line_pos = 0;
gui_buffer_ask_chat_refresh (buffer, 2);
}
}
update_prefix_max_length =
(line->data->prefix_length == lines->prefix_max_length);
@@ -640,17 +652,6 @@ gui_line_free (struct t_gui_buffer *buffer, struct t_gui_line *line)
}
}
/* reset scroll for any window starting with this line */
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if (ptr_win->start_line == line)
{
ptr_win->start_line = ptr_win->start_line->next_line;
ptr_win->start_line_pos = 0;
gui_buffer_ask_chat_refresh (buffer, 2);
}
}
/* remove line from lines list */
gui_line_remove_from_list (buffer, buffer->own_lines, line, 1);
}