summaryrefslogtreecommitdiff
path: root/amiga/gui.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2016-01-29 00:24:15 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2016-01-29 00:24:15 +0000
commitb3c524cea10d636bd7e657d274ba9f94c1d1e433 (patch)
tree7233f12bd72eaf8ee907e778f24ef0caceea2650 /amiga/gui.c
parent0ce170c18e971121e54ac60c863b523bc5874516 (diff)
downloadnetsurf-b3c524cea10d636bd7e657d274ba9f94c1d1e433.tar.gz
netsurf-b3c524cea10d636bd7e657d274ba9f94c1d1e433.tar.bz2
Move some things around to try and prevent invalid pointer accesses on exit
Diffstat (limited to 'amiga/gui.c')
-rw-r--r--amiga/gui.c41
1 files changed, 20 insertions, 21 deletions
diff --git a/amiga/gui.c b/amiga/gui.c
index fab5d14d5..c73f0d117 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -3001,6 +3001,10 @@ void ami_try_quit(void)
static void gui_quit(void)
{
+ LOG("Closing screen");
+ ami_gui_close_screen(scrn, locked_screen, FALSE);
+ if(nsscreentitle) FreeVec(nsscreentitle);
+
ami_theme_throbber_free();
urldb_save(nsoption_charp(url_file));
@@ -3019,39 +3023,18 @@ static void gui_quit(void)
ami_font_fini();
ami_help_free();
- LOG("Closing screen");
- ami_gui_close_screen(scrn, locked_screen, FALSE);
- if(nsscreentitle) FreeVec(nsscreentitle);
-
LOG("Freeing menu items");
ami_ctxmenu_free();
ami_menu_free_glyphs();
LOG("Freeing mouse pointers");
ami_mouse_pointers_free();
- LOG("Freeing clipboard");
- ami_clipboard_free();
- LOG("Freeing scheduler resources");
- ami_schedule_free();
-
- FreeSysObject(ASOT_PORT, appport);
- FreeSysObject(ASOT_PORT, sport);
- FreeSysObject(ASOT_PORT, schedulermsgport);
ami_file_req_free();
ami_openurl_close();
FreeStringClass(urlStringClass);
FreeObjList(window_list);
-
- FreeVec(current_user_options);
- FreeVec(current_user_dir);
- FreeVec(current_user_faviconcache);
- FreeVec(current_user);
-
- ami_object_fini();
-
- ami_libs_close();
}
char *ami_gui_get_cache_favicon_name(nsurl *url, bool only_if_avail)
@@ -5684,6 +5667,22 @@ int main(int argc, char** argv)
ami_mime_free();
netsurf_exit();
+
+ FreeVec(current_user_options);
+ FreeVec(current_user_dir);
+ FreeVec(current_user_faviconcache);
+ FreeVec(current_user);
+
+ ami_clipboard_free();
+ ami_schedule_free();
+
+ FreeSysObject(ASOT_PORT, appport);
+ FreeSysObject(ASOT_PORT, sport);
+ FreeSysObject(ASOT_PORT, schedulermsgport);
+
+ ami_object_fini();
+ ami_libs_close();
+
return RETURN_OK;
}