diff options
author | electrodude <electrodude@users.noreply.github.com> | 2016-05-23 13:52:26 -0400 |
---|---|---|
committer | Auke Kok <sofar+github@foo-projects.org> | 2016-05-23 10:52:26 -0700 |
commit | 10bfa30b93a896c8c4a565ef3b9984c76ab4b592 (patch) | |
tree | 7fc1ca48c1966ef0d4ddb28f33f981b48d840b60 /textures/pipeworks_deployer_side1.png | |
parent | 649c7d79f6d70251d9da93ca1c648ca2d9cc5562 (diff) | |
download | pipeworks-10bfa30b93a896c8c4a565ef3b9984c76ab4b592.tar pipeworks-10bfa30b93a896c8c4a565ef3b9984c76ab4b592.tar.gz pipeworks-10bfa30b93a896c8c4a565ef3b9984c76ab4b592.tar.bz2 pipeworks-10bfa30b93a896c8c4a565ef3b9984c76ab4b592.tar.xz pipeworks-10bfa30b93a896c8c4a565ef3b9984c76ab4b592.zip |
Fixed settings file leak and invalid io.close (#136)
Before, init.lua called io.open on
pipeworks.worldpath..'/pipeworks_settings.txt'
to see if it existed, but did not close the resulting file handle if
it was found to exist. It instead erroneously called io.close() with
no argument, which does nothing if the default output file is set to
stdout, which it is.
Now, the result of io.open is saved to a local variable. If that value
is not nil (i.e. if the world settings file exists), the file handle is
passed to io.close before calling dofile.
Also, this saves pipeworks.worldpath..'/pipeworks_settings.txt' to a
local variable to reduce redundancy.
Diffstat (limited to 'textures/pipeworks_deployer_side1.png')
0 files changed, 0 insertions, 0 deletions