Fix initialization and shutdown

This commit is contained in:
Kevin Trogant 2023-11-22 15:22:43 +01:00
parent 937ca92d9f
commit b2037519cc

View File

@ -1,6 +1,5 @@
#include "app.h" #include "app.h"
#include "config.h" #include "config.h"
#include "fio.h"
#include "gfx.h" #include "gfx.h"
#include "aio.h" #include "aio.h"
#include "renderer_api.h" #include "renderer_api.h"
@ -38,12 +37,6 @@ VY_DLLEXPORT int vyWin32Entry(HINSTANCE hInstance,
/* TODO: Parse the cvar config file */ /* TODO: Parse the cvar config file */
vy_fio_config fio_config = {0};
if (!vyInitFIO(&fio_config)) {
vyReportError("FIO", "Init failed.");
return 1;
}
if (vyInitFileTab(1024) != VY_SUCCESS) { if (vyInitFileTab(1024) != VY_SUCCESS) {
vyReportError("FTAB", "Init failed."); vyReportError("FTAB", "Init failed.");
return 1; return 1;
@ -136,7 +129,8 @@ VY_DLLEXPORT int vyWin32Entry(HINSTANCE hInstance,
UnregisterClassW(L"vyWndClass", hInstance); UnregisterClassW(L"vyWndClass", hInstance);
vyShutdownAIO(); vyShutdownAIO();
vyShutdownFIO(); vyShutdownAIO();
vyShutdownFileTab();
return 0; return 0;
} }
@ -186,9 +180,13 @@ VY_DLLEXPORT int vyXlibEntry(int argc, char **argv) {
__RegisterRuntimeCVars(); __RegisterRuntimeCVars();
vyRegisterRendererCVars(); vyRegisterRendererCVars();
vy_fio_config fio_config = {0}; if (vyInitFileTab(1024) != VY_SUCCESS) {
if (!vyInitFIO(&fio_config)) { vyReportError("FTAB", "Init failed.");
vyReportError("FIO", "Init failed."); return 1;
}
if (vyInitAIO(0) != VY_SUCCESS) {
vyReportError("AIO", "Init failed.");
return 1; return 1;
} }
@ -260,8 +258,8 @@ VY_DLLEXPORT int vyXlibEntry(int argc, char **argv) {
vyShutdownGFX(); vyShutdownGFX();
XDestroyWindow(dpy, window); XDestroyWindow(dpy, window);
XCloseDisplay(dpy); XCloseDisplay(dpy);
vyShutdownAIO();
vyShutdownFIO(); vyShutdownFileTab();
return 0; return 0;
} }