From 9348673adbbda06b382448813d2f0e0370aea7fc Mon Sep 17 00:00:00 2001 From: Amy Gale Ruth Bowersox Date: Sun, 29 Aug 2021 18:21:51 -0600 Subject: [PATCH] tied resource initialization into the main control flow --- src/main.c | 9 ++++++--- src/resources.c | 2 +- src/resources.h | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main.c b/src/main.c index c9c3456..6a176cc 100644 --- a/src/main.c +++ b/src/main.c @@ -1,12 +1,12 @@ /* * UPIWIN - Micro Pi Windowing Framework Kernel * Copyright (C) 2019 Amy Bowersox/Erbosoft Metaverse Design Solutions - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -25,6 +25,7 @@ #include "config.h" #include "gpio.h" #include "fbinit.h" +#include "resources.h" #include "fontengine.h" #include "time_func.h" #include "ep_init.h" @@ -41,6 +42,8 @@ int main(int argc, char *argv[]) return EXIT_FAILURE; else if (hr != S_OK) return EXIT_SUCCESS; + if (FAILED(Rsrc_setup())) + return EXIT_FAILURE; if (FAILED(Fb_setup())) return EXIT_FAILURE; if (FAILED(FontEng_setup())) @@ -57,7 +60,7 @@ int main(int argc, char *argv[]) Fb_clear(); if (FAILED(Epython_run())) return EXIT_FAILURE; - + Log(LINFO, "Script returned with exit code %d", Sys_Exit_Code); return Sys_Exit_Code; } diff --git a/src/resources.c b/src/resources.c index 917cb2f..5e4e286 100644 --- a/src/resources.c +++ b/src/resources.c @@ -61,7 +61,7 @@ static void rsrc_cleanup(void) sysresource = NULL; } -HRESULT Rsrc_init(void) +HRESULT Rsrc_setup(void) { HRESULT hr = S_OK; zip_source_t *syssource; diff --git a/src/resources.h b/src/resources.h index 66a1d4d..2cc4f83 100644 --- a/src/resources.h +++ b/src/resources.h @@ -27,6 +27,6 @@ typedef HANDLE HRSRC; /* handle to resource */ -extern HRESULT Rsrc_init(void); +extern HRESULT Rsrc_setup(void); #endif /* __RESOURCES_H_INCLUDED */