diff options
-rw-r--r-- | dalos-luafilter.lua | 1 | ||||
-rw-r--r-- | dalos.lua | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/dalos-luafilter.lua b/dalos-luafilter.lua index 0abf40a..c0b307e 100644 --- a/dalos-luafilter.lua +++ b/dalos-luafilter.lua @@ -96,6 +96,7 @@ end local s, v = pcall(Input, dlg.value) if not s then error("Problem loading file " .. dlg.value) end local f = preload(v) + v:destroy() if not f then error("Syntax error loading file " .. dlg.value) end local data, otype, tname = f() if otype ~= "Lua Filter" then error("Wrong template type: " .. otype) end @@ -531,6 +531,7 @@ dalosp.menu = { local s, v = pcall(Input, dlg.value) if not s then error("Problem loading file " .. dlg.value) end local f = preload(v) + v:destroy() if not f then error("Syntax error loading file " .. dlg.value) end local data = f() local tlup = dalos.objectstypes_by_name @@ -610,6 +611,7 @@ dalosp.menu = { v:write "if dalos.version.MAJOR < version.MAJOR or dalos.version.MAJOR == version.MAJOR and dalos.version.MINOR < version.MINOR then error 'Dalos version too old for this save.' end\n\nlocal " dumpvars(v, save, "save") v:write "return save" + v:destroy() else error("Failed opening " .. dlg.value .. " for writing") end @@ -661,6 +663,7 @@ dalosp.menu = { local s, v = pcall(Input, dlg.value) if not s then error("Problem loading file " .. dlg.value) end local f = preload(v) + v:destroy() if not f then error("Syntax error loading file " .. dlg.value) end local data, otype, tname = f() @@ -911,6 +914,7 @@ dalosp.object = { v:write "if dalos.version.MAJOR < version.MAJOR or dalos.version.MAJOR == version.MAJOR and dalos.version.MINOR < version.MINOR then error 'Dalos version too old for this save.' end\n\nlocal " dumpvars(v, template, "template") v:write("return template, '" .. self.ntype .. "', '" .. name .. "'") + v:destroy() else error("Failed opening " .. dlg.value .. " for writing") end |