From f13a11e31fa6a4c3fd5966a61dbc82cf94a486b3 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 8 Sep 2013 19:04:45 +0100 Subject: Destroy treeviews. --- riscos/cookies.c | 12 ++++++++++++ riscos/cookies.h | 1 + riscos/global_history.c | 12 ++++++++++++ riscos/global_history.h | 1 + riscos/gui.c | 3 +++ riscos/hotlist.c | 13 +++++++++++++ riscos/hotlist.h | 1 + 7 files changed, 43 insertions(+) diff --git a/riscos/cookies.c b/riscos/cookies.c index 7f37de812..0a1529737 100644 --- a/riscos/cookies.c +++ b/riscos/cookies.c @@ -152,6 +152,18 @@ void ro_gui_cookies_postinitialise(void) ro_gui_cookies_menu_warning); } +/** + * Destroy the cookies window. + */ + +void ro_gui_cookies_destroy(void) +{ + if (cookies_window.tv == NULL) + return; + + ro_treeview_destroy(cookies_window.tv); +} + /** * Open the cookies window. * diff --git a/riscos/cookies.h b/riscos/cookies.h index e55ca0275..b7313393e 100644 --- a/riscos/cookies.h +++ b/riscos/cookies.h @@ -28,6 +28,7 @@ void ro_gui_cookies_preinitialise(void); void ro_gui_cookies_postinitialise(void); +void ro_gui_cookies_destroy(void); bool ro_gui_cookies_check_window(wimp_w window); bool ro_gui_cookies_check_menu(wimp_menu *menu); diff --git a/riscos/global_history.c b/riscos/global_history.c index dfabbe9cf..840271f93 100644 --- a/riscos/global_history.c +++ b/riscos/global_history.c @@ -159,6 +159,18 @@ void ro_gui_global_history_postinitialise(void) ro_gui_global_history_menu_warning); } +/** + * Destroy the global history window. + */ + +void ro_gui_global_history_destroy(void) +{ + if (global_history_window.tv == NULL) + return; + + ro_treeview_destroy(global_history_window.tv); +} + /** * Open the global history window. */ diff --git a/riscos/global_history.h b/riscos/global_history.h index 99ea8c609..6f5ba11eb 100644 --- a/riscos/global_history.h +++ b/riscos/global_history.h @@ -28,6 +28,7 @@ void ro_gui_global_history_preinitialise(void); void ro_gui_global_history_postinitialise(void); +void ro_gui_global_history_destroy(void); void ro_gui_global_history_open(void); void ro_gui_global_history_save(void); bool ro_gui_global_history_check_window(wimp_w window); diff --git a/riscos/gui.c b/riscos/gui.c index 69ec7e8a3..4ce5c8154 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -919,6 +919,9 @@ void gui_quit(void) urldb_save_cookies(nsoption_charp(cookie_jar)); urldb_save(nsoption_charp(url_save)); ro_gui_window_quit(); + ro_gui_global_history_destroy(); + ro_gui_hotlist_destroy(); + ro_gui_cookies_destroy(); ro_gui_saveas_quit(); rufl_quit(); free(gui_sprites); diff --git a/riscos/hotlist.c b/riscos/hotlist.c index d00e72479..9e86542b2 100644 --- a/riscos/hotlist.c +++ b/riscos/hotlist.c @@ -182,6 +182,19 @@ void ro_gui_hotlist_postinitialise(void) ro_gui_hotlist_menu_warning); } +/** + * Destroy the hotlist window. + */ + +void ro_gui_hotlist_destroy(void) +{ + if (hotlist_window.tv == NULL) + return; + + tree_hotlist_path = nsoption_charp(hotlist_save); + ro_treeview_destroy(hotlist_window.tv); +} + /** * Open the hotlist window. diff --git a/riscos/hotlist.h b/riscos/hotlist.h index 55f8d648c..05ff08811 100644 --- a/riscos/hotlist.h +++ b/riscos/hotlist.h @@ -38,6 +38,7 @@ void ro_gui_hotlist_preinitialise(void); void ro_gui_hotlist_postinitialise(void); +void ro_gui_hotlist_destroy(void); void ro_gui_hotlist_open(void); void ro_gui_hotlist_save(void); bool ro_gui_hotlist_check_window(wimp_w window); -- cgit v1.2.3