mje Posted February 20, 2010 Report Share Posted February 20, 2010 Summary: When dealing with the XML DOM functions if you close any reference to the DOMDocument and try to use another reference to the DOMDocument, LabVIEW crashes. The DOMDocument references do not appear to count properly. See attached VI: crashtacular.vi Steps to reproduce: Open attached VI, set a path to a file which will be written. Execute the VI. Notice how the execution succeeds, and the file is written. Open the block diagram of the VI. Look for the following code... Note the call to NI_XML.lvlib:Close.vi in the diagram disabled structure. Swap the cases such that the close call is made. Warning! This will crash LabVIEW, make sure you've saved any other data you have open: Execute the VI. Expected behavior: After obtaining a new reference to the Document, I expect I should have to close it as I would any other reference I obtain dynamically. I'd only expect the Document to fall from scope after the last reference to it has been closed, instead closing any reference appears to destroy the data. This bug has existed as long as I can remember, but after being bitten by it again I decided to try to document it. What are your opinions? My $0.02: It's a bug. If it's by design, it is at best inconsistent with how references are used in the rest of the library, let alone the rest of LabVIEW or programming in general. I see no mention of it in the list of known issues, however I've seen previous posts regarding the issue over at ni.com in the past. -Michael 1 Quote Link to comment
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.