From 1b2225ea076e32412cdde273ea59510e571d84c2 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 20 Sep 2014 13:38:38 +0100 Subject: [PATCH] Move log init so it starts earlier --- amiga/gui.c | 23 +++++++++++++++-------- amiga/plugin_hack.c | 2 +- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/amiga/gui.c b/amiga/gui.c index 7ababdf74..09b731010 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -4985,6 +4985,7 @@ Object *ami_gui_splash_open(void) LayoutEnd, EndWindow; + LOG(("Attempting to open splash window...")); win = RA_OpenWindow(win_obj); GetAttrs(bm_obj, IA_Top, &top, @@ -5038,13 +5039,16 @@ Object *ami_gui_splash_open(void) void ami_gui_splash_close(Object *win_obj) { - if(win_obj) DisposeObject(win_obj); + if(win_obj == NULL) return; + + LOG(("Closing splash window")); + DisposeObject(win_obj); } static void gui_file_gadget_open(struct gui_window *g, hlcache_handle *hl, struct form_control *gadget) { - LOG(("File open dialog rquest for %p/%p", g, gadget)); + LOG(("File open dialog request for %p/%p", g, gadget)); if(AslRequestTags(filereq, ASLFR_Window, g->shared->win, @@ -5126,7 +5130,7 @@ int main(int argc, char** argv) BPTR lock = 0; int32 user = 0; nserror ret; - Object *splash_window = ami_gui_splash_open(); + struct netsurf_table amiga_table = { .browser = &amiga_browser_table, .window = &amiga_window_table, @@ -5147,6 +5151,14 @@ int main(int argc, char** argv) die("NetSurf operation table failed registration"); } + /* initialise logging. Not fatal if it fails but not much we + * can do about it either. + */ + nslog_init(NULL, &argc, argv); + + /* Open splash window */ + Object *splash_window = ami_gui_splash_open(); + /* Open popupmenu.library just to check the version. * Versions older than 53.11 are dangerous, so we * forcibly disable context menus if these are in use. @@ -5183,11 +5195,6 @@ int main(int argc, char** argv) amiga_plugin_hack_init(); ret = amiga_datatypes_init(); - /* initialise logging. Not fatal if it fails but not much we - * can do about it either. - */ - nslog_init(NULL, &argc, argv); - /* user options setup */ ret = nsoption_init(ami_set_options, &nsoptions, &nsoptions_default); if (ret != NSERROR_OK) { diff --git a/amiga/plugin_hack.c b/amiga/plugin_hack.c index 9bfd7a3d3..389cc118e 100644 --- a/amiga/plugin_hack.c +++ b/amiga/plugin_hack.c @@ -77,7 +77,7 @@ nserror amiga_plugin_hack_init(void) if(node) { - LOG(("plugin_hack registered %s\n",lwc_string_data(type))); + LOG(("plugin_hack registered %s",lwc_string_data(type))); error = content_factory_register_handler( lwc_string_data(type),