From 034a926bc92144b9e41d6a06aa8e340497a18816 Mon Sep 17 00:00:00 2001 From: Timo Smit Date: Sun, 12 Feb 2017 13:29:45 +0100 Subject: [PATCH] Fixed a file descriptor leak --- luascripts/util/files.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/luascripts/util/files.lua b/luascripts/util/files.lua index df40405..c6948f7 100644 --- a/luascripts/util/files.lua +++ b/luascripts/util/files.lua @@ -71,7 +71,10 @@ end function files.loadCFG(fileName, idExpr, fileCreate) local functionStart = et.trap_Milliseconds() - local fileString = files.open(fileName, et.FS_READ, fileCreate) + local fileString = files.open(fileName, et.FS_READ, fileCreate).."\n\n" + + et.trap_FS_FCloseFile(fileDescriptor) + local arrayCount = 0 local array = {}