jgcode Posted October 20, 2010 Report Share Posted October 20, 2010 Does anyone know 100% if I pull the Owning VI reference out of the Container State cluster's Control Refnum - do I have to explicitly close it? I am leaning towards no given the NI examples (that I have seen) don't and I am thinking it is more of a "refnum constant"? Quote Link to comment
Jeffrey Habets Posted October 20, 2010 Report Share Posted October 20, 2010 I'd say no.. My basic motto is: don't close what you didn't explicitly open. The owning VI is still in memory, even after this call to the facade finishes, so a close will probably be a nop. The one responsible for actually closing the ref (and thus cleaning up the VI object) is it's initial creator, a specific application instance. The one thing that's left is the memory location that holds the refnum (pointer to the VI object) and that should be taken care of by the garbage collector as it is for all wires that at some point on the diagram stop and their value is of nu use anymore. 100% sure? I sure hope to be close, otherwise I'm going to have to file a bug report. 1 Quote Link to comment
jgcode Posted October 20, 2010 Author Report Share Posted October 20, 2010 Cool, I agree with your points above. From interacting with Project Items tho I have been caught out before not closing refnums, so I wanted to check. FWIW and off-topic, I was playing around with the Queue implantation above, but scraped it as I didn't like it - back to booleans. Quote Link to comment
Daklu Posted October 20, 2010 Report Share Posted October 20, 2010 This is completely irrelevant to your question, but I like the icon for your dialog box. Quote Link to comment
asbo Posted October 20, 2010 Report Share Posted October 20, 2010 This is completely irrelevant to your question, but I like the icon for your dialog box. Ooooh, good call. Quote Link to comment
jdunham Posted October 20, 2010 Report Share Posted October 20, 2010 My understanding is that only "Open" functions like Open VI Reference or property/method outputs can generate a reference which needs to be closed, and that sometimes closing those is a no-op, specifically when the reference is to a front panel object. Since your reference is coming out of a cluster, something else (internal to the XControl system) is generating that reference and must take responsibility for destroying it when the XControl is released. 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.