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