10-06-2017 12:06 AM - edited 10-06-2017 12:09 AM
Hi All,
I am using TS 2016 SP1 and LV 2016. I have created and attached a sample VI and a sequence that replicates the issue. The issue can be reproduced by running the VI.
It's a simple VI that opens the reference to a sequence file & reference to a particular sequence's property object and evaluate an expression provided as an input in the VI. When I simply evaluate the expression without displaying the Expression Edit Browse dialog ('Show dialog = False'), the VI evaluates the expression and finishes without any issue and without any reference leak. But when I display the Expression Edit browse dialog ('Show dialog = True'), evaluation is successfully done but the TestStand Debug options warning dialog comes up mentioning that few references are not closed. In addition to that, LV crashes as well. What references should I close in addition to what I have already closed and why is LabVIEW crashing?
Thanks in advance,
Saranya
10-06-2017 12:41 PM
This looks incredibly similar to CAR 480759. That dialog isn't being properly disposed because the Engine isn't being shut down correctly. If you use the Application Manager control to get your Engine reference, and then call ApplicationMgr.Shutdown when your done, you shouldn't see this leak.
TestStand Help: Shutting Down the Engine
I'm going to open up a separate CAR to investigate the crash.
Trent - NI
10-06-2017 01:53 PM
After playing around with this some more, i'm also able to resolve the leak by manually assigning the Engine reference to the ExpressionEdit.Engine property. Regardless, I would recommend following the proper steps to shut down the engine.
10-08-2017 06:27 AM
Hi Trent,
I was able to solve the leak by wiring the ExpressionEdit.Engine and LV did not crash as well. Thanks for your help!
One question on the ApplicationManager Shutdown - If I have to use this, then I should have used the ApplicationManager.Start at the beginning which will also bring up the login/logout dialog, right? Is there a way to do this with launching the Login/Logout dialog, because the VI where we use the ExpressionEdit control is not a part of TS Custom UI.
As a sidenote, I have another question - Why am I not seeing the 'Create Variables' options in the Expression browser dialog? The sequence is not executing in the Sequence Editor but I am still not able to see the 'Create Local..' like option in the context menu from the Expression browser. Should I set or enable something in the Expression Edit control to achieve this?
Thanks,
Saranya
10-09-2017 09:34 AM
You can prevent the login/logout dialog by changing the LoginOnStart Property - either through the API, or by right clicking the Application Manager control and choosing 'Property Browser'.
To create variables, you can use DisplayBrowseExprDialogEx, which is an engine method.