From 1dba2c8c9239818ddbaa4bbf479b9a2e60fed48c Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Wed, 14 Apr 2010 19:24:54 +0200 Subject: [PATCH] Fix crash on /quit when scrolling in buffer and if first line displayed was from a plugin --- src/gui/gui-line.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/gui/gui-line.c b/src/gui/gui-line.c index f57d6b3d2..351adc4f3 100644 --- a/src/gui/gui-line.c +++ b/src/gui/gui-line.c @@ -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); }