Querz / mcaselector

A tool to select chunks from Minecraft worlds for deletion or export.
MIT License
3.17k stars 177 forks source link

Try with resources clean up #417

Open jimender2 opened 1 year ago

jimender2 commented 1 year ago

There were several places in the code base where an object was opened and it had the possibility of not being closed if an error was thrown.

Since the objects that I saw already implemented the Closable interface, I went ahead and added a try with resources to automatically close the objects upon error/final usage of the object. This helps to prevent memory leaks and is a best practice.