From df62f2042d061bfb963f35429d8193935d6cb9f4 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Mon, 22 Jul 2024 18:41:11 +0200 Subject: [PATCH] skinlist: avoid 'Too many open files' errors Due to application-specific file descriptor limits, the garbage collector cannot close the descriptors in time, resulting in unexpected file open errors. --- skinlist.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/skinlist.lua b/skinlist.lua index a2d4a27..a588715 100644 --- a/skinlist.lua +++ b/skinlist.lua @@ -92,6 +92,7 @@ function skins.register_skin(path, filename) skin_obj:set_meta("name", data[1]) skin_obj:set_meta("author", data[2]) skin_obj:set_meta("license", data[3]) + file:close() -- do not rely on delayed GC end end @@ -102,6 +103,7 @@ function skins.register_skin(path, filename) if fh then dbgprint("Found preview", preview_name) skin_obj:set_preview(preview_name) + fh:close() -- do not rely on delayed GC end end