/** * @brief Initializes the ui-lua interfacing environment. */ void CL_InitLua (void) { /* clean up old state */ if (cl_luastate) { CL_ShutdownLua(); } /* initialize new lua environment dedicated to the ui */ cl_luastate = luaL_newstate(); /* add basic lua libraries to the lua environment */ luaL_openlibs(cl_luastate); /* insert custom module loader */ CL_InsertModuleLoader(cl_luastate); /* add the ufo module -> exposes common functions */ luaopen_ufo (cl_luastate); /* initialize hash table for onload callback mechanism */ cl_callback = HASH_NewTable (true, true, true); }
void TEST_Shutdown (void) { PTL_InitStartup(); R_ShutdownImages(); SV_Shutdown("test shutdown", false); FS_Shutdown(); UI_Shutdown(); CL_ShutdownLua(); Cmd_Shutdown(); developer = nullptr; Cvar_Shutdown(); Mem_Shutdown(); Com_Shutdown(); Cbuf_Shutdown(); NET_Shutdown(); com_aliasSysPool = nullptr; com_cmdSysPool = nullptr; com_cmodelSysPool = nullptr; com_cvarSysPool = nullptr; com_fileSysPool = nullptr; com_genericPool = nullptr; }