safer to try to load a library full before removing metatable in case of oom

This commit is contained in:
payonel 2017-06-25 09:11:20 -07:00
parent 6a2586b536
commit e3525d9a00

View File

@ -72,9 +72,9 @@ end
function package.delay(lib, file)
local mt = {
__index = function(tbl, key)
dofile(file)
setmetatable(lib, nil)
setmetatable(lib.internal or {}, nil)
dofile(file)
return tbl[key]
end
}