viSci Posted 18 hours ago Report Posted 18 hours ago I use subpanels frequently for UI management of instrument actors in a large SCADA application. Everything works well until shutdown of the top level actor. I am seeing some evidence that the child actors running in subpanels do not shutdown gracefully. For example in the cleanup case of my subpanel actors I have the following code which attempts to save the actors control settings to an ini file. This works fine in the IDE but fails in a built exe. As far as I can tell the vi reference is still viable at the start of the Cleanup case but the ini file does not get written to. Subpanel references are handled by the messenger framework automagically so I am wondering if there might be something going on I need to consider. Also I added the Save Default Profile message which I can call from the top level prior to shutdown and that seems to work in the exe. Quote
drjdpowell Posted 54 minutes ago Report Posted 54 minutes ago I would suspect your problem is that your app closes the main window before its finished all its shutdown operations like your INI file. That is fine in source, but it is my understanding that Windows will kill a process with no open windows (Google is failing me on confirming that). Things to try: Command your subactors to shutdown and wait on their replies before stopping the top level actor and closing the main window. Then you know your subactors have executed their shutdown actions. If there is a reason you can't tell them to shutdown (and you have to rely on auto shutdown). Then you need to keep a window open until your code has a chance to execute it's cleanup, so Windows doesn't kill you first. Quote
drjdpowell Posted 14 minutes ago Report Posted 14 minutes ago Here is an example from one of my Apps, where I shutdown multiple subactors (in an array) and wait for all to reply that they have fully shutdown (I'm using Scatter-Gather to allow all to shutdown in parallel): Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.