mirror of
https://github.com/minetest-mods/skinsdb.git
synced 2024-12-22 23:40:18 +01:00
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.
This commit is contained in:
parent
b7cd514cea
commit
df62f2042d
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user