I've got a program based on messenger library that fails to shut down properly. Hoping someone can advise if I'm doing something wrong or if it's potentially a library issue. Attached is some code that reproduces the issue. There's a #info bookmark in there that will show you where you can change code to make the problem behavior go away. But a brief description:
- Main.vi loads ActorA. ActorA dynamically loads a child of Colors.lvclass (Red.lvclass) through 'Get LV Class Default Value'.
- ActorA starts up ActorB (a reentrant actor) and passes Red.lvclass to ActorB as part of the startup parameters and inserts ActorB's front panel into a subpanel on ActorA's FP.
- ActorB starts up ActorC and inserts ActorC's front panel into a subpanel on ActorB's FP.
- Upon closing Main.vi, ActorC appears to terminate correctly as it's FP disappears from ActorB.
- ActorB remains in the subpanel of ActorA and ActorA changes it's run state to 'SubVI Waiting to Run', where ActorA is not editable, nor is the FP closable. In order to shut things down, the containing project must be closed. If Main.vi is loaded directly (rather than vi a project), the only way to close ActorA is to task manager shutdown Labview. Most of the time, closing the project resets everything. However, sometimes, Labview appears to close (the Labview taskbar item in windows goes away), but there's still a Labview background process running that needs to be killed in task manager. You can notice this because labview will fail to re-open in the instances it looks closed but the background process is still there.
Observations:
- If ActorA is run directly rather than being launched from Main.vi, everything works fine.
- If ActorC is loaded via 'Get LV Class Default Value before loading Red.lvclass, everything works fine.
- The reentrancy of ActorB seems unimportant. I've changed it to non-reentrant and get the same problem.
- If I simply never run ActorC from ActorB, I also don't see the problem. Obviously that's not functionally the same, but ActorC isn't consuming the Colors/Red.lvclass data, so there really shouldn't be any relational behavior.
- I've also tried reverse sequentially shutting the Actors down through direct messages (C then B then A) rather then Auto shutting down when the parent actor dies, but the behavior is the same.
I've tried implementing the second bulleted item in my actual program with limited success. For some 3rd level actors (in place of ActorC), loading them dynamically on the front end will solve the problem.....most of the time.... But occasionally it still does fail, which makes me suspect some race condition.
I'm doing this on Windows11, LV2024Q3 32bit