Skip to content

Commit

Permalink
Close config file after reading (#239)
Browse files Browse the repository at this point in the history
Close config file after success to remove lock

Close the DCS-gRPC config file after reading it so that the file does not get locked for the duration
  • Loading branch information
Applevangelist authored Oct 19, 2023
1 parent 211f296 commit db2b21d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Fixed `MarkAddEvent`, `MarkChangeEvent` and `MarkRemoveEvent` position
- Fixed crash of concurrent Windows TTS synthesis ([#223](https://github.com/DCS-gRPC/rust-server/issues/223))
- Fixed file handler left open: Closing config file again after reading it in LUA

## [0.7.1] - 2023-01-08

Expand Down
1 change: 1 addition & 0 deletions lua/Hooks/DCS-gRPC.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ local function init()
local f = assert(loadstring(file:read("*all")))
setfenv(f, GRPC)
f()
io.close(file)
log.write("[GRPC-Hook]", log.INFO, "`Config/dcs-grpc.lua` successfully read")
else
log.write("[GRPC-Hook]", log.INFO, "`Config/dcs-grpc.lua` not found (" .. tostring(err) .. ")")
Expand Down

0 comments on commit db2b21d

Please sign in to comment.