mirror of
https://github.com/weechat/weechat.git
synced 2026-07-08 10:43:13 +02:00
A flag "closing" has been added in buffers. It is set to 1 when the buffer is closing, and then no more printf is allowed in the buffer (a message printed on relay buffer was causing a crash when it is closed).
This commit is contained in:
+9
-3
@@ -644,10 +644,10 @@ gui_chat_printf_date_tags (struct t_gui_buffer *buffer, time_t date,
|
||||
char *modifier_data, *new_msg, *ptr_msg, *lines_waiting;
|
||||
struct t_gui_line *ptr_line;
|
||||
|
||||
if (!gui_buffer_valid (buffer))
|
||||
if (!message)
|
||||
return;
|
||||
|
||||
if (!message)
|
||||
if (!gui_buffer_valid (buffer))
|
||||
return;
|
||||
|
||||
if (gui_init_ok)
|
||||
@@ -655,7 +655,7 @@ gui_chat_printf_date_tags (struct t_gui_buffer *buffer, time_t date,
|
||||
if (!buffer)
|
||||
buffer = gui_buffer_search_main ();
|
||||
|
||||
if (!buffer)
|
||||
if (!buffer || buffer->closing)
|
||||
return;
|
||||
|
||||
if (buffer->type != GUI_BUFFER_TYPE_FORMATTED)
|
||||
@@ -842,11 +842,17 @@ gui_chat_printf_y (struct t_gui_buffer *buffer, int y, const char *message, ...)
|
||||
struct t_gui_line *ptr_line;
|
||||
int i, num_lines_to_add;
|
||||
|
||||
if (!gui_buffer_valid (buffer))
|
||||
return;
|
||||
|
||||
if (gui_init_ok)
|
||||
{
|
||||
if (!buffer)
|
||||
buffer = gui_buffer_search_main ();
|
||||
|
||||
if (!buffer || buffer->closing)
|
||||
return;
|
||||
|
||||
if (buffer->type != GUI_BUFFER_TYPE_FREE)
|
||||
buffer = gui_buffers;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user