Merge branch 'dev' into generated-pcm-stream

This commit is contained in:
MihailRis
2025-11-10 12:44:49 +03:00
56 changed files with 609 additions and 242 deletions
-1
View File
@@ -114,7 +114,6 @@ events = require "core:internal/events"
function pack.unload(prefix)
events.remove_by_prefix(prefix)
__vc__pack_envs[prefix] = nil
end
function __vc_start_app_script(path)
+23 -1
View File
@@ -230,15 +230,37 @@ function require(path)
return __load_script(prefix .. ":modules/" .. file .. ".lua", nil, env)
end
function __scripts_cleanup()
-- TODO: move to string
local function join(t, sep)
local s = ""
for i, v in ipairs(t) do
s = s..tostring(v)
if i < #t then
s = s..sep
end
end
return s
end
function __scripts_cleanup(non_reset_packs)
debug.log("cleaning scripts cache")
if #non_reset_packs == 0 then
debug.log("no non-reset packs")
else
debug.log("non-reset packs: "..join(non_reset_packs, ", "))
end
for k, v in pairs(__cached_scripts) do
local packname, _ = parse_path(k)
if table.has(non_reset_packs, packname) then
goto continue
end
if packname ~= "core" then
debug.log("unloaded "..k)
__cached_scripts[k] = nil
package.loaded[k] = nil
end
__vc__pack_envs[packname] = nil
::continue::
end
end