| 702 | // *********************************************************************** |
| 703 | |
| 704 | void Close() { |
| 705 | if (!pState->appLoaded) return; |
| 706 | |
| 707 | lua_State* L = pState->pProgramState; |
| 708 | lua_getglobal(L, "close"); |
| 709 | if (lua_isfunction(L, -1)) { |
| 710 | if (lua_pcall(L, 0, 0, 0) != LUA_OK) { |
| 711 | Log::Warn("Lua Runtime Error: %s", lua_tostring(L, lua_gettop(L))); |
| 712 | } |
| 713 | } |
| 714 | |
| 715 | #ifndef _RELEASE |
| 716 | u64 bytes = lua_totalbytes(L, 0); |
| 717 | Log::Info("Luau using %u bytes (%fkb %fmb) of memory", bytes, (f32)bytes/1024, (f32)bytes/1024/1024); |
| 718 | #endif |
| 719 | lua_close(L); |
| 720 | } |
| 721 | |
| 722 | String GetAppName() { |
| 723 | return pState->appName; |