Skip to content
Snippets Groups Projects
Commit c20f74cc authored by rswindell's avatar rswindell
Browse files

Don't leak FILE streams for calls to js_CreateFileObject(), setting external

to TRUE meant the FILE* (created with fdopen) would never be closed. So we now
duplicate the file descriptor and get rid of the external flag, always closing
Files (FILE streams) upon File object finalize.
This fixes the resource leak leading to the eventual "Error 24 opening ..." in
the ircd.js when loaded via jsexec, on Windows. This error happened after
169 calls to load(true,...), because each background load creates 3 Files
(for stdin/out/err) and those FILE streams were never closed/freed, and
169 * 3 = 507, plus a few open files = 512, the maximum number of open file
streams in the Microsoft CRTL apparently. Thanks to Deuce for recognizing these
numbers as "magic" and pointing to the likely cause.
parent 437edfa4
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment