core: fix crash on buffer close when option weechat.look.hotlist_remove is set to "merged" (closes #199)
This commit is contained in:
parent
f91f57f12c
commit
c1aa51fa9c
@ -28,6 +28,8 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
|
|||||||
|
|
||||||
=== Bugs fixed
|
=== Bugs fixed
|
||||||
|
|
||||||
|
* core: fix crash on buffer close when option weechat.look.hotlist_remove is
|
||||||
|
set to "merged" (closes #199)
|
||||||
* core: fix highlight of IRC action messages when option irc.look.nick_mode is
|
* core: fix highlight of IRC action messages when option irc.look.nick_mode is
|
||||||
set to "action" or "both" (closes #206)
|
set to "action" or "both" (closes #206)
|
||||||
* core: fix compilation of plugin API functions (macros) when compiler
|
* core: fix compilation of plugin API functions (macros) when compiler
|
||||||
|
@ -1224,7 +1224,7 @@ gui_window_switch_to_buffer (struct t_gui_window *window,
|
|||||||
gui_buffer_compute_num_displayed ();
|
gui_buffer_compute_num_displayed ();
|
||||||
|
|
||||||
if (!weechat_upgrading && (old_buffer != buffer))
|
if (!weechat_upgrading && (old_buffer != buffer))
|
||||||
gui_hotlist_remove_buffer (buffer);
|
gui_hotlist_remove_buffer (buffer, 0);
|
||||||
|
|
||||||
gui_bar_window_remove_unused_bars (window);
|
gui_bar_window_remove_unused_bars (window);
|
||||||
gui_bar_window_add_missing_bars (window);
|
gui_bar_window_add_missing_bars (window);
|
||||||
|
@ -1730,7 +1730,7 @@ gui_buffer_set (struct t_gui_buffer *buffer, const char *property,
|
|||||||
if (error && !error[0])
|
if (error && !error[0])
|
||||||
{
|
{
|
||||||
if (number < 0)
|
if (number < 0)
|
||||||
gui_hotlist_remove_buffer (buffer);
|
gui_hotlist_remove_buffer (buffer, 0);
|
||||||
else
|
else
|
||||||
(void) gui_hotlist_add (buffer, number, NULL);
|
(void) gui_hotlist_add (buffer, number, NULL);
|
||||||
}
|
}
|
||||||
@ -2480,7 +2480,7 @@ gui_buffer_clear (struct t_gui_buffer *buffer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gui_hotlist_remove_buffer (buffer);
|
gui_hotlist_remove_buffer (buffer, 0);
|
||||||
|
|
||||||
gui_buffer_ask_chat_refresh (buffer, 2);
|
gui_buffer_ask_chat_refresh (buffer, 2);
|
||||||
|
|
||||||
@ -2601,7 +2601,7 @@ gui_buffer_close (struct t_gui_buffer *buffer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gui_hotlist_remove_buffer (buffer);
|
gui_hotlist_remove_buffer (buffer, 1);
|
||||||
if (gui_hotlist_initial_buffer == buffer)
|
if (gui_hotlist_initial_buffer == buffer)
|
||||||
gui_hotlist_initial_buffer = NULL;
|
gui_hotlist_initial_buffer = NULL;
|
||||||
|
|
||||||
|
@ -487,7 +487,8 @@ gui_hotlist_clear ()
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
gui_hotlist_remove_buffer (struct t_gui_buffer *buffer)
|
gui_hotlist_remove_buffer (struct t_gui_buffer *buffer,
|
||||||
|
int force_remove_buffer)
|
||||||
{
|
{
|
||||||
int hotlist_changed, hotlist_remove, buffer_to_remove;
|
int hotlist_changed, hotlist_remove, buffer_to_remove;
|
||||||
struct t_gui_hotlist *ptr_hotlist, *next_hotlist;
|
struct t_gui_hotlist *ptr_hotlist, *next_hotlist;
|
||||||
@ -504,19 +505,22 @@ gui_hotlist_remove_buffer (struct t_gui_buffer *buffer)
|
|||||||
{
|
{
|
||||||
next_hotlist = ptr_hotlist->next_hotlist;
|
next_hotlist = ptr_hotlist->next_hotlist;
|
||||||
|
|
||||||
buffer_to_remove = 0;
|
buffer_to_remove = (force_remove_buffer) ?
|
||||||
|
(ptr_hotlist->buffer == buffer) : 0;
|
||||||
|
|
||||||
switch (hotlist_remove)
|
switch (hotlist_remove)
|
||||||
{
|
{
|
||||||
case CONFIG_LOOK_HOTLIST_REMOVE_BUFFER:
|
case CONFIG_LOOK_HOTLIST_REMOVE_BUFFER:
|
||||||
buffer_to_remove = (ptr_hotlist->buffer == buffer);
|
buffer_to_remove |= (ptr_hotlist->buffer == buffer);
|
||||||
break;
|
break;
|
||||||
case CONFIG_LOOK_HOTLIST_REMOVE_MERGED:
|
case CONFIG_LOOK_HOTLIST_REMOVE_MERGED:
|
||||||
buffer_to_remove =
|
buffer_to_remove |=
|
||||||
((ptr_hotlist->buffer->number == buffer->number)
|
((ptr_hotlist->buffer->number == buffer->number)
|
||||||
&& (!ptr_hotlist->buffer->zoomed
|
&& (!ptr_hotlist->buffer->zoomed
|
||||||
|| (ptr_hotlist->buffer->active == 2)));
|
|| (ptr_hotlist->buffer->active == 2)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buffer_to_remove)
|
if (buffer_to_remove)
|
||||||
{
|
{
|
||||||
gui_hotlist_free (&gui_hotlist, &last_gui_hotlist, ptr_hotlist);
|
gui_hotlist_free (&gui_hotlist, &last_gui_hotlist, ptr_hotlist);
|
||||||
|
@ -59,7 +59,8 @@ extern struct t_gui_hotlist *gui_hotlist_add (struct t_gui_buffer *buffer,
|
|||||||
struct timeval *creation_time);
|
struct timeval *creation_time);
|
||||||
extern void gui_hotlist_resort ();
|
extern void gui_hotlist_resort ();
|
||||||
extern void gui_hotlist_clear ();
|
extern void gui_hotlist_clear ();
|
||||||
extern void gui_hotlist_remove_buffer (struct t_gui_buffer *buffer);
|
extern void gui_hotlist_remove_buffer (struct t_gui_buffer *buffer,
|
||||||
|
int force_remove_buffer);
|
||||||
extern struct t_hdata *gui_hotlist_hdata_hotlist_cb (void *data,
|
extern struct t_hdata *gui_hotlist_hdata_hotlist_cb (void *data,
|
||||||
const char *hdata_name);
|
const char *hdata_name);
|
||||||
extern int gui_hotlist_add_to_infolist (struct t_infolist *infolist,
|
extern int gui_hotlist_add_to_infolist (struct t_infolist *infolist,
|
||||||
|
@ -1383,7 +1383,7 @@ gui_input_jump_smart (struct t_gui_buffer *buffer)
|
|||||||
if (!gui_hotlist_initial_buffer)
|
if (!gui_hotlist_initial_buffer)
|
||||||
gui_hotlist_initial_buffer = window->buffer;
|
gui_hotlist_initial_buffer = window->buffer;
|
||||||
gui_window_switch_to_buffer (window, gui_hotlist->buffer, 1);
|
gui_window_switch_to_buffer (window, gui_hotlist->buffer, 1);
|
||||||
gui_hotlist_remove_buffer (window->buffer);
|
gui_hotlist_remove_buffer (window->buffer, 0);
|
||||||
scroll_to_bottom = 1;
|
scroll_to_bottom = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1673,7 +1673,7 @@ gui_window_search_stop (struct t_gui_window *window)
|
|||||||
}
|
}
|
||||||
window->scroll->start_line = NULL;
|
window->scroll->start_line = NULL;
|
||||||
window->scroll->start_line_pos = 0;
|
window->scroll->start_line_pos = 0;
|
||||||
gui_hotlist_remove_buffer (window->buffer);
|
gui_hotlist_remove_buffer (window->buffer, 0);
|
||||||
gui_buffer_ask_chat_refresh (window->buffer, 2);
|
gui_buffer_ask_chat_refresh (window->buffer, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user