soulsmods / DSMapStudio

A standalone map/level editor for Demon's Souls, Dark Souls 1/2/3, Bloodborne, Sekiro, and Elden Ring.
MIT License
447 stars 58 forks source link

File handles aren't closed properly #934

Open RunDevelopment opened 3 weeks ago

RunDevelopment commented 3 weeks ago

I just discovered that DSMS doesn't close file handles properly after loading a map.

I noticed this because I wasn't able to delete a mapbnd from DS3 file until I closed DSMS. The same also happened with a tpfbdt. This is a huge problem for me, because I mainly mod DS3 via a custom program I made that modifies game files for me. So DSMS locking those files completely ruins my workflow...

I'm very certain that this is a resource leak, because the files were still considered in use by the OS even after I unloaded the map in DSMS. I also noticed that which files were considered in use was random. Sometimes it was just a few dozen, sometimes more, and always different files.

I confirmed that this bug is present in versions 1.10 and 1.11.1. Version 1.06 doesn't have the bug.