Luke Kolin Posted yesterday at 02:45 PM Report Posted yesterday at 02:45 PM I have a LUA script for my aircraft that runs and handles custom actions for button presses. I've registered a shutdown handler to run when the sim shuts down, and it is being called correctly. The last three lines in the shutdown handler are as follows: event.cancel("HandleShutdown") ipc.log("TFDi MD-11 Button Handler shutdown (" .. btnCount .. " buttons, " .. updCount .. " LED updates)") ipc.exit() When P3Dv5 shuts down, the handler is called correctly, and I can see the last log line execute. However, in the log I see a 2150ms wait time, then the LUA thread gets killed. Should it not be dead already given the ipc.exit()? Full FSUIPC log attached. Cheers FSUIPC6.log
John Dowson Posted 10 hours ago Report Posted 10 hours ago An ipc.exit() call will not do anything when called in a shutdown handler as the thread is already exiting. A shutdown handler is only needed to close any opened resources really - files, ports (com), pipes, etc. No need to cancel events. John
Luke Kolin Posted 5 hours ago Author Report Posted 5 hours ago That's helpful. Is this part of the log expected: 662000 Lua threads being terminated: 662000 1 = "D:\Program Files\FSUIPC6\tfdimd11.lua" 662000 LUA: "D:\Program Files\FSUIPC6\tfdimd11.lua": killed It feels like an unclean shutdown. Cheers
John Dowson Posted 4 hours ago Report Posted 4 hours ago 31 minutes ago, Luke Kolin said: It feels like an unclean shutdown. It is expected (if the lua thread does not exit of its own accord in the required time limit) and it is forced / unclean shutdown, but nothing to worry about. You can try increasing the TimeForLuaClosing ini parameter, but this may not help either. But it really is nothing to worry about. A lua termination handler should only be used to free any windows resources acquired.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now