-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[LUA] File handles are not released #455
Comments
If the lua console is closed, the vm should be destroyed. I would expect the handle to get GC'd and the file closed. |
https://www.lua.org/manual/5.1/manual.html#pdf-file:close
|
EmuLuaLibrary's Close() method clobbers the _lua without calling Close() on it. |
This bug is still happening to me on 2.3.2 When I restart a script that uses a specific file (not generating a unique file name for each run) opened in "w+" mode, the file doesn't get initially truncated to a zero-length file like it's supposed to. If I manually delete it, it won't get recreated no matter how many times I restart the script, instead the file writes fail silently with no indication anything went wrong until I go to check on the file and it's not there. If I restart bizhawk then it will work. I was going to file a new bug but the issue tracker suggested it might be a duplicate of this one, and after looking at it I think it was right, I think it's this It seems like the bug fix didn't work perfectly or else it's regressed since then. Maybe the lua engine switch from #867 has something to do with it? IDRK. EDIT: Actually the original bug only reported this happening when the whole lua console is closed. For me, it happens when "refreshing" or removing and re-importing a particular script, not necessarily closing the whole lua console. I'm going to make a new report after all, though I strongly suspect it might be related. |
I'm not sure if this is something we can really do anything about, but if a script opens a file using
io.open
and the emulator is paused, the lua console closed, then the file handle is not released and thus one needs to exit EmuHawk in order to release the file handle.The text was updated successfully, but these errors were encountered: