diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2005-02-22 19:32:37 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2005-02-22 19:32:37 +0000 |
commit | 24d0c49ae447a1c2184ed500390561cbcf00f0bb (patch) | |
tree | 168907fc6233a676427394b3eab15a35ea4bef75 /src/gui/gui-common.c | |
parent | 559b651669b17ed8015cefc0e25a4ff52f9cdb45 (diff) | |
download | weechat-24d0c49ae447a1c2184ed500390561cbcf00f0bb.zip |
Fixed crash when quitting WeeChat
Diffstat (limited to 'src/gui/gui-common.c')
-rw-r--r-- | src/gui/gui-common.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/gui-common.c b/src/gui/gui-common.c index f64d79bea..633d4acf1 100644 --- a/src/gui/gui-common.c +++ b/src/gui/gui-common.c @@ -337,7 +337,7 @@ gui_infobar_printf (int time_displayed, int color, char *message, ...) void gui_window_free (t_gui_window *window) { - if (window->buffer->num_displayed > 0) + if (window->buffer && (window->buffer->num_displayed > 0)) window->buffer->num_displayed--; /* remove window from windows list */ @@ -458,6 +458,12 @@ gui_buffer_free (t_gui_buffer *buffer, int switch_to_another) if (last_gui_buffer == buffer) last_gui_buffer = buffer->prev_buffer; + for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window) + { + if (ptr_win->buffer == buffer) + ptr_win->buffer = NULL; + } + free (buffer); /* always at least one buffer */ |