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:
+12
-11
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user