quelea-projection / Quelea

Open source projection software for churches.
https://quelea.org
GNU General Public License v3.0
154 stars 145 forks source link

Fix Resource Leaks (part 1) #605

Closed jbubik closed 1 year ago

jbubik commented 1 year ago

In EpicWorshipParser and SongBeamerParser the input files were opened and never closed. Not a big bug as these import functions are rarely used. Files were closed at Quelea's termination. Fixed anyway with this PR.

jbubik commented 1 year ago

Michael, thanks for pointing me to try-with-resources block. Now it's fixed properly.

PS: my aim is not to remove the warnings just for themselves. I try to fix real issues. Leaked resources (files held open until the termination of Quelea) can turn into issues if many accumulate over the app's lifetime.