diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-05-06 17:30:13 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-05-06 17:30:13 +0200 |
commit | 72721d7205e5724178c0e6ff29f32edfcccc8823 (patch) | |
tree | 73c404e7e80ee16ff57afba3bb17b2f71a4b9e74 /src/gui/curses/gui-curses-main.c | |
parent | e9603acb1a1943bda3c2cc809e5e39ff8a13b68c (diff) | |
download | weechat-72721d7205e5724178c0e6ff29f32edfcccc8823.zip |
Do not clean all GUI objects when crashing after SIGSEGV (this can cause crash inside crash!)
Diffstat (limited to 'src/gui/curses/gui-curses-main.c')
-rw-r--r-- | src/gui/curses/gui-curses-main.c | 67 |
1 files changed, 36 insertions, 31 deletions
diff --git a/src/gui/curses/gui-curses-main.c b/src/gui/curses/gui-curses-main.c index 3578775e8..a0347361b 100644 --- a/src/gui/curses/gui-curses-main.c +++ b/src/gui/curses/gui-curses-main.c @@ -313,41 +313,46 @@ gui_main_loop () /* * gui_main_end: GUI end + * clean_exit is 0 when WeeChat is crashing (we don't clean + * objects because WeeChat can crash again during this cleanup...) */ void -gui_main_end () +gui_main_end (int clean_exit) { - /* remove bar items and bars */ - gui_bar_item_end (); - gui_bar_free_all (); - - /* free clipboard buffer */ - if (gui_input_clipboard) - free (gui_input_clipboard); - - /* delete all windows */ - while (gui_windows) - gui_window_free (gui_windows); - gui_window_tree_free (&gui_windows_tree); - - /* delete all buffers */ - while (gui_buffers) - gui_buffer_close (gui_buffers, 0); - - /* delete global history */ - gui_history_global_free (); - - /* delete infobar messages */ - while (gui_infobar) - gui_infobar_remove (); - - /* reset title */ - if (CONFIG_BOOLEAN(config_look_set_title)) - gui_window_title_reset (); - - /* end color */ - gui_color_end (); + if (clean_exit) + { + /* remove bar items and bars */ + gui_bar_item_end (); + gui_bar_free_all (); + + /* free clipboard buffer */ + if (gui_input_clipboard) + free (gui_input_clipboard); + + /* delete all windows */ + while (gui_windows) + gui_window_free (gui_windows); + gui_window_tree_free (&gui_windows_tree); + + /* delete all buffers */ + while (gui_buffers) + gui_buffer_close (gui_buffers, 0); + + /* delete global history */ + gui_history_global_free (); + + /* delete infobar messages */ + while (gui_infobar) + gui_infobar_remove (); + + /* reset title */ + if (CONFIG_BOOLEAN(config_look_set_title)) + gui_window_title_reset (); + + /* end color */ + gui_color_end (); + } /* end of Curses output */ refresh (); |