Close temp file when there's an error (#103)

* Close temp file when there's an error so you don't have to wait for garbage collection of the file in order to load another dupe.
This commit is contained in:
thegrb93 2016-10-20 04:27:11 -05:00 committed by Abigail
parent b79287b7f8
commit 1c39b8ed0e

View File

@ -375,10 +375,14 @@ local function deserialize(str)
buff:Close()
buff = file.Open("ad2temp.txt","rb", "DATA")
local tbl = read()
local success, tbl = pcall(read)
buff:Close()
return tbl
if success then
return tbl
else
error(tbl)
end
end
--[[